[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180508180436.716-74-mfasheh@suse.de>
Date: Tue, 8 May 2018 11:04:33 -0700
From: Mark Fasheh <mfasheh@...e.de>
To: linux-fsdevel@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, linux-btrfs@...r.kernel.org,
Mark Fasheh <mfasheh@...e.de>
Subject: [PATCH 73/76] vfs: Move s_dev to to struct fs_view
There are many places where a dev_t:ino_t pair are passed to userspace
to uniquely describe an inode. Some file systems, like btrfs, have
multiple inode namespace internally and use a separate dev_t to make the
distinction between them.
The kernel typically uses sb->s_dev for the inode device. Most filesystems
are fine with that but btrfs needs to use the device beloning to the root
which that inode resides on. By moving s_dev into the fs_view we allow btrfs
and any similar filesystems to set this field on a per inode basis.
This patch adds a dev_t field to struct fs_view, v_dev and removes s_dev
from struct super_block. I also include a helper, inode_view() to make
referencing inode->i_view fields less clunky.
Signed-off-by: Mark Fasheh <mfasheh@...e.de>
---
include/linux/fs.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5d4bb19b2a43..c93486505084 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1351,6 +1351,7 @@ struct sb_writers {
*/
struct fs_view {
struct super_block *v_sb;
+ dev_t v_dev; /* search index; _not_ kdev_t */
};
static inline struct super_block *inode_sb(const struct inode *inode)
@@ -1358,9 +1359,13 @@ static inline struct super_block *inode_sb(const struct inode *inode)
return inode->i_view->v_sb;
}
+static inline struct fs_view *inode_view(const struct inode *inode)
+{
+ return inode->i_view;
+}
+
struct super_block {
struct list_head s_list; /* Keep this first */
- dev_t s_dev; /* search index; _not_ kdev_t */
unsigned char s_blocksize_bits;
unsigned long s_blocksize;
loff_t s_maxbytes; /* Max file size */
--
2.15.1
Powered by blists - more mailing lists