Merge branch 'linux-linaro-lsk' into linux-linaro-lsk-android
[firefly-linux-kernel-4.4.55.git] / fs / btrfs / ulist.h
index 21a1963439c3030c0146a1994f47a38fd43e0a95..fb36731074b5fa6ed5e27be3cca08caf329631ee 100644 (file)
@@ -8,6 +8,9 @@
 #ifndef __ULIST__
 #define __ULIST__
 
+#include <linux/list.h>
+#include <linux/rbtree.h>
+
 /*
  * ulist is a generic data structure to hold a collection of unique u64
  * values. The only operations it supports is adding to the list and
@@ -34,6 +37,7 @@ struct ulist_iterator {
 struct ulist_node {
        u64 val;                /* value to store */
        u64 aux;                /* auxiliary value saved along with the val */
+       struct rb_node rb_node; /* used to speed up search */
 };
 
 struct ulist {
@@ -54,6 +58,8 @@ struct ulist {
         */
        struct ulist_node *nodes;
 
+       struct rb_root root;
+
        /*
         * inline storage space for the first ULIST_SIZE entries
         */