aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/kobject.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-09-20 03:05:12 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-10-12 17:51:11 -0400
commita4e8b912541d5372ae049a3b7c1979968e52c40b (patch)
treea95937748b6216f914abe55ed47c2627e7856bf7 /include/linux/kobject.h
parent85a4ffad3de77177591f7c2c18c26c3c8dd28bff (diff)
sysfs: move sysfs file poll implementation to sysfs_open_dirent
Sysfs file poll implementation is scattered over sysfs and kobject. Event numbering is done in sysfs_dirent but wait itself is done on kobject. This not only unecessarily bloats both kobject and sysfs_dirent but is also buggy - if a sysfs_dirent is removed while there still are pollers, the associaton betwen the kobject and sysfs_dirent breaks and kobject may be freed with the pollers still sleeping on it. This patch moves whole poll implementation into sysfs_open_dirent. Each time a sysfs_open_dirent is created, event number restarts from 1 and pollers sleep on sysfs_open_dirent. As event sequence number is meaningless without any open file and pollers should have open file and thus sysfs_open_dirent, this ephemeral event counting works and is a saner implementation. This patch fixes the dnagling sleepers bug and reduces the sizes of kobject and sysfs_dirent by one pointer. 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 'include/linux/kobject.h')
-rw-r--r--include/linux/kobject.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 0777b3f57ae6..a8a84fcccbc0 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -66,7 +66,6 @@ struct kobject {
66 struct kset * kset; 66 struct kset * kset;
67 struct kobj_type * ktype; 67 struct kobj_type * ktype;
68 struct sysfs_dirent * sd; 68 struct sysfs_dirent * sd;
69 wait_queue_head_t poll;
70}; 69};
71 70
72extern int kobject_set_name(struct kobject *, const char *, ...) 71extern int kobject_set_name(struct kobject *, const char *, ...)