[PATCH 46/76] fs/kernfs: Use inode_sb() helper instead of inode->i_sb
From: Mark Fasheh
Date: Tue May 08 2018 - 14:06:05 EST
Signed-off-by: Mark Fasheh <mfasheh@xxxxxxx>
---
fs/kernfs/dir.c | 4 ++--
fs/kernfs/inode.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/kernfs/dir.c b/fs/kernfs/dir.c
index 89d1dc19340b..1239244e826a 100644
--- a/fs/kernfs/dir.c
+++ b/fs/kernfs/dir.c
@@ -1059,7 +1059,7 @@ static struct dentry *kernfs_iop_lookup(struct inode *dir,
mutex_lock(&kernfs_mutex);
if (kernfs_ns_enabled(parent))
- ns = kernfs_info(dir->i_sb)->ns;
+ ns = kernfs_info(inode_sb(dir))->ns;
kn = kernfs_find_ns(parent, dentry->d_name.name, ns);
@@ -1070,7 +1070,7 @@ static struct dentry *kernfs_iop_lookup(struct inode *dir,
}
/* attach dentry and inode */
- inode = kernfs_get_inode(dir->i_sb, kn);
+ inode = kernfs_get_inode(inode_sb(dir), kn);
if (!inode) {
ret = ERR_PTR(-ENOMEM);
goto out_unlock;
diff --git a/fs/kernfs/inode.c b/fs/kernfs/inode.c
index a34303981deb..7b005800d815 100644
--- a/fs/kernfs/inode.c
+++ b/fs/kernfs/inode.c
@@ -173,7 +173,7 @@ static inline void set_default_inode_attr(struct inode *inode, umode_t mode)
static inline void set_inode_attr(struct inode *inode, struct iattr *iattr)
{
- struct super_block *sb = inode->i_sb;
+ struct super_block *sb = inode_sb(inode);
inode->i_uid = iattr->ia_uid;
inode->i_gid = iattr->ia_gid;
inode->i_atime = timespec_trunc(iattr->ia_atime, sb->s_time_gran);
--
2.15.1