1
linux/fs/sysfs
Tejun Heo a4e8b91254 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>
2007-10-12 14:51:11 -07:00
..
bin.c sysfs: make s_elem an anonymous union 2007-10-12 14:51:10 -07:00
dir.c sysfs: move sysfs file poll implementation to sysfs_open_dirent 2007-10-12 14:51:11 -07:00
file.c sysfs: move sysfs file poll implementation to sysfs_open_dirent 2007-10-12 14:51:11 -07:00
group.c sysfs: Remove first pass at shadow directory support 2007-10-12 14:51:03 -07:00
inode.c sysfs: move sysfs_dirent->s_children into sysfs_dirent->s_dir 2007-10-12 14:51:11 -07:00
Makefile
mount.c sysfs: make sysfs_root a regular directory dirent 2007-10-12 14:51:11 -07:00
symlink.c sysfs: make s_elem an anonymous union 2007-10-12 14:51:10 -07:00
sysfs.h sysfs: move sysfs file poll implementation to sysfs_open_dirent 2007-10-12 14:51:11 -07:00