diff options
author | Tejun Heo <htejun@gmail.com> | 2007-06-13 14:45:18 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-11 19:09:07 -0400 |
commit | 0c73f18b7d95de8a007039337063a770b5fc8e7a (patch) | |
tree | cf3b6f274139b170136219918dd679f2397e69f6 /fs/sysfs/mount.c | |
parent | 8619f979898397582e366877fd5feeba7560d70c (diff) |
sysfs: use singly-linked list for sysfs_dirent tree
Make sysfs_dirent use singly linked list for its tree structure.
sysfs_link_sibling() and sysfs_unlink_sibling() functions are added to
handle simpler cases. It adds some complexity and cpu cycle overhead
but reduced memory footprint is worthwhile on big machines.
This change reduces the sizeof sysfs_dirent from 104 to 88 on 64bit
and from 60 to 52 on 32bit.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/mount.c')
-rw-r--r-- | fs/sysfs/mount.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c index d0e160307c5d..4be9593ea000 100644 --- a/fs/sysfs/mount.c +++ b/fs/sysfs/mount.c | |||
@@ -26,11 +26,8 @@ static const struct super_operations sysfs_ops = { | |||
26 | 26 | ||
27 | static struct sysfs_dirent sysfs_root = { | 27 | static struct sysfs_dirent sysfs_root = { |
28 | .s_count = ATOMIC_INIT(1), | 28 | .s_count = ATOMIC_INIT(1), |
29 | .s_sibling = LIST_HEAD_INIT(sysfs_root.s_sibling), | ||
30 | .s_children = LIST_HEAD_INIT(sysfs_root.s_children), | ||
31 | .s_type = SYSFS_ROOT, | 29 | .s_type = SYSFS_ROOT, |
32 | .s_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO, | 30 | .s_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO, |
33 | .s_iattr = NULL, | ||
34 | .s_ino = 1, | 31 | .s_ino = 1, |
35 | }; | 32 | }; |
36 | 33 | ||