summaryrefslogtreecommitdiffstats
path: root/fs/sysfs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysfs/file.c')
-rw-r--r--fs/sysfs/file.c16
1 files changed, 8 insertions, 8 deletions
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);