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>
This commit is contained in:
Mikulas Patocka
2011-07-25 17:55:57 -04:00
committed by Greg Kroah-Hartman
parent 7f9838fd01
commit 4f72c0cab4
2 changed files with 55 additions and 7 deletions

View File

@@ -11,6 +11,7 @@
#include <linux/lockdep.h>
#include <linux/kobject_ns.h>
#include <linux/fs.h>
#include <linux/rbtree.h>
struct sysfs_open_dirent;
@@ -21,6 +22,8 @@ struct sysfs_elem_dir {
struct sysfs_dirent *children;
unsigned long subdirs;
struct rb_root name_tree;
};
struct sysfs_elem_symlink {
@@ -61,6 +64,8 @@ struct sysfs_dirent {
struct sysfs_dirent *s_sibling;
const char *s_name;
struct rb_node name_node;
const void *s_ns; /* namespace tag */
union {
struct sysfs_elem_dir s_dir;