diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2011-07-25 17:55:57 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-22 20:43:52 -0400 |
commit | 4f72c0cab40536a0be501d85ea4918467ab82ad5 (patch) | |
tree | f5f0cc385fed9a32f7fc4451f8618c3b4120bc3d /fs/sysfs/sysfs.h | |
parent | 7f9838fd01833ffb30177d964983076924344c9e (diff) |
sysfs: use rb-tree for name lookups
sysfs: use rb-tree for name lookups
Use red-black tree for name lookups.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/sysfs/sysfs.h')
-rw-r--r-- | fs/sysfs/sysfs.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h index 6348e2c753f6..fe1a9e8650bf 100644 --- a/fs/sysfs/sysfs.h +++ b/fs/sysfs/sysfs.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/lockdep.h> | 11 | #include <linux/lockdep.h> |
12 | #include <linux/kobject_ns.h> | 12 | #include <linux/kobject_ns.h> |
13 | #include <linux/fs.h> | 13 | #include <linux/fs.h> |
14 | #include <linux/rbtree.h> | ||
14 | 15 | ||
15 | struct sysfs_open_dirent; | 16 | struct sysfs_open_dirent; |
16 | 17 | ||
@@ -21,6 +22,8 @@ struct sysfs_elem_dir { | |||
21 | struct sysfs_dirent *children; | 22 | struct sysfs_dirent *children; |
22 | 23 | ||
23 | unsigned long subdirs; | 24 | unsigned long subdirs; |
25 | |||
26 | struct rb_root name_tree; | ||
24 | }; | 27 | }; |
25 | 28 | ||
26 | struct sysfs_elem_symlink { | 29 | struct sysfs_elem_symlink { |
@@ -61,6 +64,8 @@ struct sysfs_dirent { | |||
61 | struct sysfs_dirent *s_sibling; | 64 | struct sysfs_dirent *s_sibling; |
62 | const char *s_name; | 65 | const char *s_name; |
63 | 66 | ||
67 | struct rb_node name_node; | ||
68 | |||
64 | const void *s_ns; /* namespace tag */ | 69 | const void *s_ns; /* namespace tag */ |
65 | union { | 70 | union { |
66 | struct sysfs_elem_dir s_dir; | 71 | struct sysfs_elem_dir s_dir; |