sysfs: use rb-tree for inode number lookup
[deliverable/linux.git] / fs / sysfs / sysfs.h
index 845ab3ad229d60616807bb39f0adaceb73a3ad8e..ce29e28b766d9dbe6812ca506e6fbb0f7a44ec9e 100644 (file)
 #include <linux/lockdep.h>
 #include <linux/kobject_ns.h>
 #include <linux/fs.h>
+#include <linux/rbtree.h>
 
 struct sysfs_open_dirent;
 
 /* type-specific structures for sysfs_dirent->s_* union members */
 struct sysfs_elem_dir {
        struct kobject          *kobj;
-       /* children list starts here and goes through sd->s_sibling */
-       struct sysfs_dirent     *children;
+
+       unsigned long           subdirs;
+
+       struct rb_root          inode_tree;
+       struct rb_root          name_tree;
 };
 
 struct sysfs_elem_symlink {
@@ -56,9 +60,16 @@ struct sysfs_dirent {
        struct lockdep_map      dep_map;
 #endif
        struct sysfs_dirent     *s_parent;
-       struct sysfs_dirent     *s_sibling;
        const char              *s_name;
 
+       struct rb_node          inode_node;
+       struct rb_node          name_node;
+
+       union {
+               struct completion       *completion;
+               struct sysfs_dirent     *removed_list;
+       } u;
+
        const void              *s_ns; /* namespace tag */
        union {
                struct sysfs_elem_dir           s_dir;
This page took 0.025242 seconds and 5 git commands to generate.