aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs
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 18:43:48 -0500
commitadc5e8b58f4886d45f79f4ff41a09001a76a6b12 (patch)
treee77d7c1cb4c7b9fcf236b329cb486750dbaef860 /fs/sysfs
parent324a56e16e44baecac3ca799fd216154145c14bf (diff)
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/sysfs')
-rw-r--r--fs/sysfs/dir.c12
-rw-r--r--fs/sysfs/file.c16
-rw-r--r--fs/sysfs/symlink.c6
3 files changed, 17 insertions, 17 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index f1efe3df0de6..4a800017558d 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -29,11 +29,11 @@ DEFINE_SPINLOCK(sysfs_symlink_target_lock);
29 */ 29 */
30static char *sysfs_pathname(struct kernfs_node *kn, char *path) 30static char *sysfs_pathname(struct kernfs_node *kn, char *path)
31{ 31{
32 if (kn->s_parent) { 32 if (kn->parent) {
33 sysfs_pathname(kn->s_parent, path); 33 sysfs_pathname(kn->parent, path);
34 strlcat(path, "/", PATH_MAX); 34 strlcat(path, "/", PATH_MAX);
35 } 35 }
36 strlcat(path, kn->s_name, PATH_MAX); 36 strlcat(path, kn->name, PATH_MAX);
37 return path; 37 return path;
38} 38}
39 39
@@ -121,7 +121,7 @@ void sysfs_remove_dir(struct kobject *kobj)
121int sysfs_rename_dir_ns(struct kobject *kobj, const char *new_name, 121int sysfs_rename_dir_ns(struct kobject *kobj, const char *new_name,
122 const void *new_ns) 122 const void *new_ns)
123{ 123{
124 struct kernfs_node *parent = kobj->sd->s_parent; 124 struct kernfs_node *parent = kobj->sd->parent;
125 125
126 return kernfs_rename_ns(kobj->sd, parent, new_name, new_ns); 126 return kernfs_rename_ns(kobj->sd, parent, new_name, new_ns);
127} 127}
@@ -132,9 +132,9 @@ int sysfs_move_dir_ns(struct kobject *kobj, struct kobject *new_parent_kobj,
132 struct kernfs_node *kn = kobj->sd; 132 struct kernfs_node *kn = kobj->sd;
133 struct kernfs_node *new_parent; 133 struct kernfs_node *new_parent;
134 134
135 BUG_ON(!kn->s_parent); 135 BUG_ON(!kn->parent);
136 new_parent = new_parent_kobj && new_parent_kobj->sd ? 136 new_parent = new_parent_kobj && new_parent_kobj->sd ?
137 new_parent_kobj->sd : sysfs_root_kn; 137 new_parent_kobj->sd : sysfs_root_kn;
138 138
139 return kernfs_rename_ns(kn, new_parent, kn->s_name, new_ns); 139 return kernfs_rename_ns(kn, new_parent, kn->name, new_ns);
140} 140}
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index be1cc39035bd..887703a79065 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -27,9 +27,9 @@
27 */ 27 */
28static const struct sysfs_ops *sysfs_file_ops(struct kernfs_node *kn) 28static const struct sysfs_ops *sysfs_file_ops(struct kernfs_node *kn)
29{ 29{
30 struct kobject *kobj = kn->s_parent->priv; 30 struct kobject *kobj = kn->parent->priv;
31 31
32 if (kn->s_flags & SYSFS_FLAG_LOCKDEP) 32 if (kn->flags & SYSFS_FLAG_LOCKDEP)
33 lockdep_assert_held(kn); 33 lockdep_assert_held(kn);
34 return kobj->ktype ? kobj->ktype->sysfs_ops : NULL; 34 return kobj->ktype ? kobj->ktype->sysfs_ops : NULL;
35} 35}
@@ -42,7 +42,7 @@ static const struct sysfs_ops *sysfs_file_ops(struct kernfs_node *kn)
42static int sysfs_kf_seq_show(struct seq_file *sf, void *v) 42static int sysfs_kf_seq_show(struct seq_file *sf, void *v)
43{ 43{
44 struct sysfs_open_file *of = sf->private; 44 struct sysfs_open_file *of = sf->private;
45 struct kobject *kobj = of->kn->s_parent->priv; 45 struct kobject *kobj = of->kn->parent->priv;
46 const struct sysfs_ops *ops = sysfs_file_ops(of->kn); 46 const struct sysfs_ops *ops = sysfs_file_ops(of->kn);
47 ssize_t count; 47 ssize_t count;
48 char *buf; 48 char *buf;
@@ -82,7 +82,7 @@ static ssize_t sysfs_kf_bin_read(struct sysfs_open_file *of, char *buf,
82 size_t count, loff_t pos) 82 size_t count, loff_t pos)
83{ 83{
84 struct bin_attribute *battr = of->kn->priv; 84 struct bin_attribute *battr = of->kn->priv;
85 struct kobject *kobj = of->kn->s_parent->priv; 85 struct kobject *kobj = of->kn->parent->priv;
86 loff_t size = file_inode(of->file)->i_size; 86 loff_t size = file_inode(of->file)->i_size;
87 87
88 if (!count) 88 if (!count)
@@ -106,7 +106,7 @@ static ssize_t sysfs_kf_write(struct sysfs_open_file *of, char *buf,
106 size_t count, loff_t pos) 106 size_t count, loff_t pos)
107{ 107{
108 const struct sysfs_ops *ops = sysfs_file_ops(of->kn); 108 const struct sysfs_ops *ops = sysfs_file_ops(of->kn);
109 struct kobject *kobj = of->kn->s_parent->priv; 109 struct kobject *kobj = of->kn->parent->priv;
110 110
111 if (!count) 111 if (!count)
112 return 0; 112 return 0;
@@ -119,7 +119,7 @@ static ssize_t sysfs_kf_bin_write(struct sysfs_open_file *of, char *buf,
119 size_t count, loff_t pos) 119 size_t count, loff_t pos)
120{ 120{
121 struct bin_attribute *battr = of->kn->priv; 121 struct bin_attribute *battr = of->kn->priv;
122 struct kobject *kobj = of->kn->s_parent->priv; 122 struct kobject *kobj = of->kn->parent->priv;
123 loff_t size = file_inode(of->file)->i_size; 123 loff_t size = file_inode(of->file)->i_size;
124 124
125 if (size) { 125 if (size) {
@@ -140,7 +140,7 @@ static int sysfs_kf_bin_mmap(struct sysfs_open_file *of,
140 struct vm_area_struct *vma) 140 struct vm_area_struct *vma)
141{ 141{
142 struct bin_attribute *battr = of->kn->priv; 142 struct bin_attribute *battr = of->kn->priv;
143 struct kobject *kobj = of->kn->s_parent->priv; 143 struct kobject *kobj = of->kn->parent->priv;
144 144
145 return battr->mmap(of->file, kobj, battr, vma); 145 return battr->mmap(of->file, kobj, battr, vma);
146} 146}
@@ -345,7 +345,7 @@ int sysfs_chmod_file(struct kobject *kobj, const struct attribute *attr,
345 if (!kn) 345 if (!kn)
346 return -ENOENT; 346 return -ENOENT;
347 347
348 newattrs.ia_mode = (mode & S_IALLUGO) | (kn->s_mode & ~S_IALLUGO); 348 newattrs.ia_mode = (mode & S_IALLUGO) | (kn->mode & ~S_IALLUGO);
349 newattrs.ia_valid = ATTR_MODE; 349 newattrs.ia_valid = ATTR_MODE;
350 350
351 rc = kernfs_setattr(kn, &newattrs); 351 rc = kernfs_setattr(kn, &newattrs);
diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c
index 4ed3d49ad279..0d48ea911508 100644
--- a/fs/sysfs/symlink.c
+++ b/fs/sysfs/symlink.c
@@ -129,7 +129,7 @@ void sysfs_delete_link(struct kobject *kobj, struct kobject *targ,
129 */ 129 */
130 spin_lock(&sysfs_symlink_target_lock); 130 spin_lock(&sysfs_symlink_target_lock);
131 if (targ->sd && kernfs_ns_enabled(kobj->sd)) 131 if (targ->sd && kernfs_ns_enabled(kobj->sd))
132 ns = targ->sd->s_ns; 132 ns = targ->sd->ns;
133 spin_unlock(&sysfs_symlink_target_lock); 133 spin_unlock(&sysfs_symlink_target_lock);
134 kernfs_remove_by_name_ns(kobj->sd, name, ns); 134 kernfs_remove_by_name_ns(kobj->sd, name, ns);
135} 135}
@@ -175,7 +175,7 @@ int sysfs_rename_link_ns(struct kobject *kobj, struct kobject *targ,
175 parent = kobj->sd; 175 parent = kobj->sd;
176 176
177 if (targ->sd) 177 if (targ->sd)
178 old_ns = targ->sd->s_ns; 178 old_ns = targ->sd->ns;
179 179
180 result = -ENOENT; 180 result = -ENOENT;
181 kn = kernfs_find_and_get_ns(parent, old, old_ns); 181 kn = kernfs_find_and_get_ns(parent, old, old_ns);
@@ -185,7 +185,7 @@ int sysfs_rename_link_ns(struct kobject *kobj, struct kobject *targ,
185 result = -EINVAL; 185 result = -EINVAL;
186 if (sysfs_type(kn) != SYSFS_KOBJ_LINK) 186 if (sysfs_type(kn) != SYSFS_KOBJ_LINK)
187 goto out; 187 goto out;
188 if (kn->s_symlink.target_kn->priv != targ) 188 if (kn->symlink.target_kn->priv != targ)
189 goto out; 189 goto out;
190 190
191 result = kernfs_rename_ns(kn, parent, new, new_ns); 191 result = kernfs_rename_ns(kn, parent, new, new_ns);