remarkable-linux/fs/sysfs
Eric W. Biederman 3efa65b92d sysfs: Simplify readdir.
At some point someone wrote sysfs_readdir to insert a cursor
into the list of sysfs_dirents to ensure that sysfs_readdir would
restart properly.  That works but it is complex code and tends
to be expensive.

The same effect can be achieved by keeping the sysfs_dirents in
inode order and using the inode number as the f_pos.  Then
when we restart we just have to find the first dirent whose inode
number is equal or greater then the last sysfs_dirent we attempted
to return.

Removing the sysfs directory cursor also allows the remove of
all of the mysterious checks for sysfs_type(sd) != 0.   Which
were nonbovious checks to see if a cursor was in a directory list.

tj: offset marker for EOF is changed from UINT_MAX to INT_MAX to avoid
    overflow in case offset is 32bit.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-10-12 14:51:08 -07:00
..
bin.c sysfs: cleanup semaphore.h 2007-10-12 14:51:03 -07:00
dir.c sysfs: Simplify readdir. 2007-10-12 14:51:08 -07:00
file.c sysfs: Fix typos in fs/sysfs/file.c 2007-10-12 14:51:06 -07:00
group.c sysfs: Remove first pass at shadow directory support 2007-10-12 14:51:03 -07:00
inode.c sysfs: Remove sysfs_instantiate 2007-10-12 14:51:07 -07:00
Makefile
mount.c sysfs: Make sysfs_mount static 2007-10-12 14:51:07 -07:00
symlink.c sysfs: Make sysfs_mount static 2007-10-12 14:51:07 -07:00
sysfs.h sysfs: Make sysfs_mount static 2007-10-12 14:51:07 -07:00