linux_old1/fs/sysfs
Tejun Heo 8619f97989 sysfs: slim down sysfs_dirent->s_active
Make sysfs_dirent->s_active an atomic_t instead of rwsem.  This
reduces the size of sysfs_dirent from 136 to 104 on 64bit and from 76
to 60 on 32bit with lock debugging turned off.  With lock debugging
turned on the reduction is much larger.

s_active starts at zero and each active reference increments s_active.
Putting a reference decrements s_active.  Deactivation subtracts
SD_DEACTIVATED_BIAS which is currently INT_MIN and assumed to be small
enough to make s_active negative.  If s_active is negative,
sysfs_get() no longer grants new references.  Deactivation succeeds
immediately if there is no active user; otherwise, it waits using a
completion for the last put.

Due to the removal of lockdep tricks, this change makes things less
trickier in release_sysfs_dirent().  As all the complexity is
contained in three s_active functions, I think it's more readable this
way.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-07-11 16:09:07 -07:00
..
Makefile Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
bin.c sysfs: kill unnecessary attribute->owner 2007-07-11 16:09:06 -07:00
dir.c sysfs: slim down sysfs_dirent->s_active 2007-07-11 16:09:07 -07:00
file.c sysfs: kill unnecessary attribute->owner 2007-07-11 16:09:06 -07:00
group.c security: prevent permission checking of file removal via sysfs_remove_group() 2007-04-27 10:57:33 -07:00
inode.c sysfs: use iget_locked() instead of new_inode() 2007-07-11 16:09:07 -07:00
mount.c sysfs: fix root sysfs_dirent -> root dentry association 2007-07-11 16:09:07 -07:00
symlink.c sysfs: reimplement symlink using sysfs_dirent tree 2007-07-11 16:09:04 -07:00
sysfs.h sysfs: slim down sysfs_dirent->s_active 2007-07-11 16:09:07 -07:00