summaryrefslogtreecommitdiffstats
path: root/fs/kernfs/inode.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-12-11 14:11:54 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-12-11 15:43:48 -0800
commitadc5e8b58f4886d45f79f4ff41a09001a76a6b12 (patch)
treee77d7c1cb4c7b9fcf236b329cb486750dbaef860 /fs/kernfs/inode.c
parent324a56e16e44baecac3ca799fd216154145c14bf (diff)
downloadop-kernel-dev-adc5e8b58f4886d45f79f4ff41a09001a76a6b12.zip
op-kernel-dev-adc5e8b58f4886d45f79f4ff41a09001a76a6b12.tar.gz
kernfs: drop s_ prefix from kernfs_node members
kernfs has just been separated out from sysfs and we're already in full conflict mode. Nothing can make the situation any worse. Let's take the chance to name things properly. s_ prefix for kernfs members is used inconsistently and a misnomer now. It's not like kernfs_node is used widely across the kernel making the ability to grep for the members particularly useful. Let's just drop the prefix. This patch is strictly rename only and doesn't introduce any functional difference. Signed-off-by: Tejun Heo <tj@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/kernfs/inode.c')
-rw-r--r--fs/kernfs/inode.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/fs/kernfs/inode.c b/fs/kernfs/inode.c
index 9e74eed..f6c0aae 100644
--- a/fs/kernfs/inode.c
+++ b/fs/kernfs/inode.c
@@ -50,23 +50,23 @@ static struct sysfs_inode_attrs *sysfs_inode_attrs(struct kernfs_node *kn)
{
struct iattr *iattrs;
- if (kn->s_iattr)
- return kn->s_iattr;
+ if (kn->iattr)
+ return kn->iattr;
- kn->s_iattr = kzalloc(sizeof(struct sysfs_inode_attrs), GFP_KERNEL);
- if (!kn->s_iattr)
+ kn->iattr = kzalloc(sizeof(struct sysfs_inode_attrs), GFP_KERNEL);
+ if (!kn->iattr)
return NULL;
- iattrs = &kn->s_iattr->ia_iattr;
+ iattrs = &kn->iattr->ia_iattr;
/* assign default attributes */
- iattrs->ia_mode = kn->s_mode;
+ iattrs->ia_mode = kn->mode;
iattrs->ia_uid = GLOBAL_ROOT_UID;
iattrs->ia_gid = GLOBAL_ROOT_GID;
iattrs->ia_atime = iattrs->ia_mtime = iattrs->ia_ctime = CURRENT_TIME;
- simple_xattrs_init(&kn->s_iattr->xattrs);
+ simple_xattrs_init(&kn->iattr->xattrs);
- return kn->s_iattr;
+ return kn->iattr;
}
static int __kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr)
@@ -93,7 +93,7 @@ static int __kernfs_setattr(struct kernfs_node *kn, const struct iattr *iattr)
iattrs->ia_ctime = iattr->ia_ctime;
if (ia_valid & ATTR_MODE) {
umode_t mode = iattr->ia_mode;
- iattrs->ia_mode = kn->s_mode = mode;
+ iattrs->ia_mode = kn->mode = mode;
}
return 0;
}
@@ -256,9 +256,9 @@ static inline void set_inode_attr(struct inode *inode, struct iattr *iattr)
static void sysfs_refresh_inode(struct kernfs_node *kn, struct inode *inode)
{
- struct sysfs_inode_attrs *attrs = kn->s_iattr;
+ struct sysfs_inode_attrs *attrs = kn->iattr;
- inode->i_mode = kn->s_mode;
+ inode->i_mode = kn->mode;
if (attrs) {
/*
* kernfs_node has non-default attributes get them from
@@ -270,7 +270,7 @@ static void sysfs_refresh_inode(struct kernfs_node *kn, struct inode *inode)
}
if (sysfs_type(kn) == SYSFS_DIR)
- set_nlink(inode, kn->s_dir.subdirs + 2);
+ set_nlink(inode, kn->dir.subdirs + 2);
}
int sysfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
@@ -295,7 +295,7 @@ static void sysfs_init_inode(struct kernfs_node *kn, struct inode *inode)
inode->i_mapping->backing_dev_info = &sysfs_backing_dev_info;
inode->i_op = &sysfs_inode_operations;
- set_default_inode_attr(inode, kn->s_mode);
+ set_default_inode_attr(inode, kn->mode);
sysfs_refresh_inode(kn, inode);
/* initialize inode according to type */
@@ -305,7 +305,7 @@ static void sysfs_init_inode(struct kernfs_node *kn, struct inode *inode)
inode->i_fop = &sysfs_dir_operations;
break;
case SYSFS_KOBJ_ATTR:
- inode->i_size = kn->s_attr.size;
+ inode->i_size = kn->attr.size;
inode->i_fop = &kernfs_file_operations;
break;
case SYSFS_KOBJ_LINK:
@@ -337,7 +337,7 @@ struct inode *sysfs_get_inode(struct super_block *sb, struct kernfs_node *kn)
{
struct inode *inode;
- inode = iget_locked(sb, kn->s_ino);
+ inode = iget_locked(sb, kn->ino);
if (inode && (inode->i_state & I_NEW))
sysfs_init_inode(kn, inode);
OpenPOWER on IntegriCloud