Merge branches 'x86-cpu-for-linus', 'x86-boot-for-linus', 'x86-cpufeature-for-linus...
[firefly-linux-kernel-4.4.55.git] / fs / sysfs / sysfs.h
index 7484a36ee67863f7bc28c2a053104480b92456c5..661a9639570b973dcce69ac3abc4bdbe84cb6991 100644 (file)
@@ -20,9 +20,8 @@ struct sysfs_elem_dir {
        struct kobject          *kobj;
 
        unsigned long           subdirs;
-
-       struct rb_root          inode_tree;
-       struct rb_root          name_tree;
+       /* children rbtree starts here and goes through sd->s_rb */
+       struct rb_root          children;
 };
 
 struct sysfs_elem_symlink {
@@ -62,8 +61,7 @@ struct sysfs_dirent {
        struct sysfs_dirent     *s_parent;
        const char              *s_name;
 
-       struct rb_node          inode_node;
-       struct rb_node          name_node;
+       struct rb_node          s_rb;
 
        union {
                struct completion       *completion;
@@ -71,6 +69,7 @@ struct sysfs_dirent {
        } u;
 
        const void              *s_ns; /* namespace tag */
+       unsigned int            s_hash; /* ns + name hash */
        union {
                struct sysfs_elem_dir           s_dir;
                struct sysfs_elem_symlink       s_symlink;
@@ -78,9 +77,9 @@ struct sysfs_dirent {
                struct sysfs_elem_bin_attr      s_bin_attr;
        };
 
-       unsigned int            s_flags;
+       unsigned short          s_flags;
        umode_t                 s_mode;
-       ino_t                   s_ino;
+       unsigned int            s_ino;
        struct sysfs_inode_attrs *s_iattr;
 };
 
@@ -95,11 +94,11 @@ struct sysfs_dirent {
 #define SYSFS_ACTIVE_REF               (SYSFS_KOBJ_ATTR | SYSFS_KOBJ_BIN_ATTR)
 
 /* identify any namespace tag on sysfs_dirents */
-#define SYSFS_NS_TYPE_MASK             0xff00
+#define SYSFS_NS_TYPE_MASK             0xf00
 #define SYSFS_NS_TYPE_SHIFT            8
 
 #define SYSFS_FLAG_MASK                        ~(SYSFS_NS_TYPE_MASK|SYSFS_TYPE_MASK)
-#define SYSFS_FLAG_REMOVED             0x020000
+#define SYSFS_FLAG_REMOVED             0x02000
 
 static inline unsigned int sysfs_type(struct sysfs_dirent *sd)
 {