]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/linux/sysctl.h
sysctl: Index sysctl directories with rbtrees.
[karo-tx-linux.git] / include / linux / sysctl.h
index 36dec756ef9dabd2e3e521a9a5e6d4f99b1efae5..35c50ed36fc98fe6c108922d5f2b436046ad4726 100644 (file)
@@ -932,6 +932,7 @@ enum
 #include <linux/list.h>
 #include <linux/rcupdate.h>
 #include <linux/wait.h>
+#include <linux/rbtree.h>
 
 /* For the /proc/sys support */
 struct ctl_table;
@@ -1023,6 +1024,11 @@ struct ctl_table
        void *extra2;
 };
 
+struct ctl_node {
+       struct rb_node node;
+       struct ctl_table_header *header;
+};
+
 /* struct ctl_table_header is used to maintain dynamic lists of
    struct ctl_table trees. */
 struct ctl_table_header
@@ -1030,7 +1036,6 @@ struct ctl_table_header
        union {
                struct {
                        struct ctl_table *ctl_table;
-                       struct list_head ctl_entry;
                        int used;
                        int count;
                        int nreg;
@@ -1042,12 +1047,13 @@ struct ctl_table_header
        struct ctl_table_root *root;
        struct ctl_table_set *set;
        struct ctl_dir *parent;
+       struct ctl_node *node;
 };
 
 struct ctl_dir {
        /* Header must be at the start of ctl_dir */
        struct ctl_table_header header;
-       struct list_head list;
+       struct rb_root root;
 };
 
 struct ctl_table_set {