Lines Matching refs:rb

20 	struct rb_node rb;  member
39 if (key < rb_entry(parent, struct test_node, rb)->key) in insert()
45 rb_link_node(&node->rb, parent, new); in insert()
46 rb_insert_color(&node->rb, &root->rb_root); in insert()
57 if (key < rb_entry(parent, struct test_node, rb)->key) in insert_cached()
65 rb_link_node(&node->rb, parent, new); in insert_cached()
66 rb_insert_color_cached(&node->rb, root, leftmost); in insert_cached()
71 rb_erase(&node->rb, &root->rb_root); in erase()
76 rb_erase_cached(&node->rb, root); in erase_cached()
83 struct test_node, rb, u32, augmented, NODE_VAL) in RB_DECLARE_CALLBACKS_MAX() argument
95 parent = rb_entry(rb_parent, struct test_node, rb); in RB_DECLARE_CALLBACKS_MAX()
99 new = &parent->rb.rb_left; in RB_DECLARE_CALLBACKS_MAX()
101 new = &parent->rb.rb_right; in RB_DECLARE_CALLBACKS_MAX()
105 rb_link_node(&node->rb, rb_parent, new); in RB_DECLARE_CALLBACKS_MAX()
106 rb_insert_augmented(&node->rb, &root->rb_root, &augment_callbacks); in RB_DECLARE_CALLBACKS_MAX()
120 parent = rb_entry(rb_parent, struct test_node, rb); in insert_augmented_cached()
124 new = &parent->rb.rb_left; in insert_augmented_cached()
126 new = &parent->rb.rb_right; in insert_augmented_cached()
132 rb_link_node(&node->rb, rb_parent, new); in insert_augmented_cached()
133 rb_insert_augmented_cached(&node->rb, root, in insert_augmented_cached()
140 rb_erase_augmented(&node->rb, &root->rb_root, &augment_callbacks); in erase_augmented()
146 rb_erase_augmented_cached(&node->rb, root, &augment_callbacks); in erase_augmented_cached()
158 static bool is_red(struct rb_node *rb) in is_red() argument
160 return !(rb->__rb_parent_color & 1); in is_red()
163 static int black_path_count(struct rb_node *rb) in black_path_count() argument
166 for (count = 0; rb; rb = rb_parent(rb)) in black_path_count()
167 count += !is_red(rb); in black_path_count()
175 rbtree_postorder_for_each_entry_safe(cur, n, &root.rb_root, rb) in check_postorder_foreach()
183 struct rb_node *rb; in check_postorder() local
185 for (rb = rb_first_postorder(&root.rb_root); rb; rb = rb_next_postorder(rb)) in check_postorder()
193 struct rb_node *rb; in check() local
197 for (rb = rb_first(&root.rb_root); rb; rb = rb_next(rb)) { in check()
198 struct test_node *node = rb_entry(rb, struct test_node, rb); in check()
200 WARN_ON_ONCE(is_red(rb) && in check()
201 (!rb_parent(rb) || is_red(rb_parent(rb)))); in check()
203 blacks = black_path_count(rb); in check()
205 WARN_ON_ONCE((!rb->rb_left || !rb->rb_right) && in check()
206 blacks != black_path_count(rb)); in check()
220 struct rb_node *rb; in check_augmented() local
223 for (rb = rb_first(&root.rb_root); rb; rb = rb_next(rb)) { in check_augmented()
224 struct test_node *node = rb_entry(rb, struct test_node, rb); in check_augmented()
226 if (node->rb.rb_left) { in check_augmented()
227 subtree = rb_entry(node->rb.rb_left, struct test_node, in check_augmented()
228 rb)->augmented; in check_augmented()
232 if (node->rb.rb_right) { in check_augmented()
233 subtree = rb_entry(node->rb.rb_right, struct test_node, in check_augmented()
234 rb)->augmented; in check_augmented()