diff options
author | Tejun Heo <htejun@gmail.com> | 2007-09-20 03:05:11 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-10-12 17:51:10 -0400 |
commit | b1fc3d6144d56360d1373b01c7881826f558b6cd (patch) | |
tree | 3bac4c3df21dc74c6373c3e4a22c3ea6b01b1832 /fs/sysfs/file.c | |
parent | 078ce6409ca54d5fc6eb7d2147cd6efc3eb09078 (diff) |
sysfs: make s_elem an anonymous union
Make s_elem an anonymous union. Prefixing with s_elem makes things
needlessly longer without any advantage.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/file.c')
-rw-r--r-- | fs/sysfs/file.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 8f1ebd88b9ce..3c91a57a1ed2 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c | |||
@@ -73,7 +73,7 @@ struct sysfs_buffer { | |||
73 | static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer) | 73 | static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer) |
74 | { | 74 | { |
75 | struct sysfs_dirent *attr_sd = dentry->d_fsdata; | 75 | struct sysfs_dirent *attr_sd = dentry->d_fsdata; |
76 | struct kobject *kobj = attr_sd->s_parent->s_elem.dir.kobj; | 76 | struct kobject *kobj = attr_sd->s_parent->s_dir.kobj; |
77 | struct sysfs_ops * ops = buffer->ops; | 77 | struct sysfs_ops * ops = buffer->ops; |
78 | int ret = 0; | 78 | int ret = 0; |
79 | ssize_t count; | 79 | ssize_t count; |
@@ -88,7 +88,7 @@ static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer | |||
88 | return -ENODEV; | 88 | return -ENODEV; |
89 | 89 | ||
90 | buffer->event = atomic_read(&attr_sd->s_event); | 90 | buffer->event = atomic_read(&attr_sd->s_event); |
91 | count = ops->show(kobj, attr_sd->s_elem.attr.attr, buffer->page); | 91 | count = ops->show(kobj, attr_sd->s_attr.attr, buffer->page); |
92 | 92 | ||
93 | sysfs_put_active_two(attr_sd); | 93 | sysfs_put_active_two(attr_sd); |
94 | 94 | ||
@@ -188,7 +188,7 @@ static int | |||
188 | flush_write_buffer(struct dentry * dentry, struct sysfs_buffer * buffer, size_t count) | 188 | flush_write_buffer(struct dentry * dentry, struct sysfs_buffer * buffer, size_t count) |
189 | { | 189 | { |
190 | struct sysfs_dirent *attr_sd = dentry->d_fsdata; | 190 | struct sysfs_dirent *attr_sd = dentry->d_fsdata; |
191 | struct kobject *kobj = attr_sd->s_parent->s_elem.dir.kobj; | 191 | struct kobject *kobj = attr_sd->s_parent->s_dir.kobj; |
192 | struct sysfs_ops * ops = buffer->ops; | 192 | struct sysfs_ops * ops = buffer->ops; |
193 | int rc; | 193 | int rc; |
194 | 194 | ||
@@ -196,7 +196,7 @@ flush_write_buffer(struct dentry * dentry, struct sysfs_buffer * buffer, size_t | |||
196 | if (!sysfs_get_active_two(attr_sd)) | 196 | if (!sysfs_get_active_two(attr_sd)) |
197 | return -ENODEV; | 197 | return -ENODEV; |
198 | 198 | ||
199 | rc = ops->store(kobj, attr_sd->s_elem.attr.attr, buffer->page, count); | 199 | rc = ops->store(kobj, attr_sd->s_attr.attr, buffer->page, count); |
200 | 200 | ||
201 | sysfs_put_active_two(attr_sd); | 201 | sysfs_put_active_two(attr_sd); |
202 | 202 | ||
@@ -240,7 +240,7 @@ sysfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t | |||
240 | static int sysfs_open_file(struct inode *inode, struct file *file) | 240 | static int sysfs_open_file(struct inode *inode, struct file *file) |
241 | { | 241 | { |
242 | struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata; | 242 | struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata; |
243 | struct kobject *kobj = attr_sd->s_parent->s_elem.dir.kobj; | 243 | struct kobject *kobj = attr_sd->s_parent->s_dir.kobj; |
244 | struct sysfs_buffer * buffer; | 244 | struct sysfs_buffer * buffer; |
245 | struct sysfs_ops * ops = NULL; | 245 | struct sysfs_ops * ops = NULL; |
246 | int error; | 246 | int error; |
@@ -336,7 +336,7 @@ static unsigned int sysfs_poll(struct file *filp, poll_table *wait) | |||
336 | { | 336 | { |
337 | struct sysfs_buffer * buffer = filp->private_data; | 337 | struct sysfs_buffer * buffer = filp->private_data; |
338 | struct sysfs_dirent *attr_sd = filp->f_path.dentry->d_fsdata; | 338 | struct sysfs_dirent *attr_sd = filp->f_path.dentry->d_fsdata; |
339 | struct kobject *kobj = attr_sd->s_parent->s_elem.dir.kobj; | 339 | struct kobject *kobj = attr_sd->s_parent->s_dir.kobj; |
340 | 340 | ||
341 | /* need parent for the kobj, grab both */ | 341 | /* need parent for the kobj, grab both */ |
342 | if (!sysfs_get_active_two(attr_sd)) | 342 | if (!sysfs_get_active_two(attr_sd)) |
@@ -396,7 +396,7 @@ int sysfs_add_file(struct sysfs_dirent *dir_sd, const struct attribute *attr, | |||
396 | sd = sysfs_new_dirent(attr->name, mode, type); | 396 | sd = sysfs_new_dirent(attr->name, mode, type); |
397 | if (!sd) | 397 | if (!sd) |
398 | return -ENOMEM; | 398 | return -ENOMEM; |
399 | sd->s_elem.attr.attr = (void *)attr; | 399 | sd->s_attr.attr = (void *)attr; |
400 | 400 | ||
401 | sysfs_addrm_start(&acxt, dir_sd); | 401 | sysfs_addrm_start(&acxt, dir_sd); |
402 | rc = sysfs_add_one(&acxt, sd); | 402 | rc = sysfs_add_one(&acxt, sd); |