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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8619f97989
commit
0c73f18b7d
@@ -26,11 +26,8 @@ static const struct super_operations sysfs_ops = {
|
||||
|
||||
static struct sysfs_dirent sysfs_root = {
|
||||
.s_count = ATOMIC_INIT(1),
|
||||
.s_sibling = LIST_HEAD_INIT(sysfs_root.s_sibling),
|
||||
.s_children = LIST_HEAD_INIT(sysfs_root.s_children),
|
||||
.s_type = SYSFS_ROOT,
|
||||
.s_mode = S_IFDIR | S_IRWXU | S_IRUGO | S_IXUGO,
|
||||
.s_iattr = NULL,
|
||||
.s_ino = 1,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user