|
17 | 17 | #ifndef _LINUX_RBTREE_H
|
18 | 18 | #define _LINUX_RBTREE_H
|
19 | 19 |
|
| 20 | +#include <linux/rbtree_types.h> |
| 21 | + |
20 | 22 | #include <linux/kernel.h>
|
21 | 23 | #include <linux/stddef.h>
|
22 | 24 | #include <linux/rcupdate.h>
|
23 | 25 |
|
24 |
| -struct rb_node { |
25 |
| - unsigned long __rb_parent_color; |
26 |
| - struct rb_node *rb_right; |
27 |
| - struct rb_node *rb_left; |
28 |
| -} __attribute__((aligned(sizeof(long)))); |
29 |
| - /* The alignment might seem pointless, but allegedly CRIS needs it */ |
30 |
| - |
31 |
| -struct rb_root { |
32 |
| - struct rb_node *rb_node; |
33 |
| -}; |
34 |
| - |
35 | 26 | #define rb_parent(r) ((struct rb_node *)((r)->__rb_parent_color & ~3))
|
36 | 27 |
|
37 |
| -#define RB_ROOT (struct rb_root) { NULL, } |
38 | 28 | #define rb_entry(ptr, type, member) container_of(ptr, type, member)
|
39 | 29 |
|
40 | 30 | #define RB_EMPTY_ROOT(root) (READ_ONCE((root)->rb_node) == NULL)
|
@@ -112,23 +102,6 @@ static inline void rb_link_node_rcu(struct rb_node *node, struct rb_node *parent
|
112 | 102 | typeof(*pos), field); 1; }); \
|
113 | 103 | pos = n)
|
114 | 104 |
|
115 |
| -/* |
116 |
| - * Leftmost-cached rbtrees. |
117 |
| - * |
118 |
| - * We do not cache the rightmost node based on footprint |
119 |
| - * size vs number of potential users that could benefit |
120 |
| - * from O(1) rb_last(). Just not worth it, users that want |
121 |
| - * this feature can always implement the logic explicitly. |
122 |
| - * Furthermore, users that want to cache both pointers may |
123 |
| - * find it a bit asymmetric, but that's ok. |
124 |
| - */ |
125 |
| -struct rb_root_cached { |
126 |
| - struct rb_root rb_root; |
127 |
| - struct rb_node *rb_leftmost; |
128 |
| -}; |
129 |
| - |
130 |
| -#define RB_ROOT_CACHED (struct rb_root_cached) { {NULL, }, NULL } |
131 |
| - |
132 | 105 | /* Same as rb_first(), but O(1) */
|
133 | 106 | #define rb_first_cached(root) (root)->rb_leftmost
|
134 | 107 |
|
|
0 commit comments