Lines Matching refs:rb_node
81 static void rb_tree_insert_rebalance(struct rb_tree *, struct rb_node *);
82 static void rb_tree_removal_rebalance(struct rb_tree *, struct rb_node *,
85 static const struct rb_node *rb_tree_iterate_const(const struct rb_tree *,
86 const struct rb_node *, const unsigned int);
87 static bool rb_tree_check_node(const struct rb_tree *, const struct rb_node *,
88 const struct rb_node *, bool);
127 struct rb_node *parent = rbt->rbt_root;
146 struct rb_node *parent = rbt->rbt_root, *last = NULL;
167 struct rb_node *parent = rbt->rbt_root, *last = NULL;
188 struct rb_node *parent, *tmp, *self = RB_ITEMTONODE(rbto, object);
196 * This is a hack. Because rbt->rbt_root is just a struct rb_node *,
197 * just like rb_node->rb_nodes[RB_DIR_LEFT], we can use this fact to
199 * updating RB_FATHER(rb_node)->rb_nodes[RB_POSITION(rb_node)] will
202 parent = (struct rb_node *)(void *)&rbt->rbt_root;
225 struct rb_node *prev = NULL, *next = NULL;
255 if (__predict_false(parent == (struct rb_node *)(void *)&rbt->rbt_root)) {
329 struct rb_node *old_father, const unsigned int which)
332 struct rb_node * const grandpa = RB_FATHER(old_father);
333 struct rb_node * const old_child = old_father->rb_nodes[which];
334 struct rb_node * const new_father = old_child;
335 struct rb_node * const new_child = old_father;
366 struct rb_node tmp;
392 rb_tree_insert_rebalance(struct rb_tree *rbt, struct rb_node *self)
394 struct rb_node * father = RB_FATHER(self);
395 struct rb_node * grandpa = RB_FATHER(father);
396 struct rb_node * uncle;
498 rb_tree_prune_node(struct rb_tree *rbt, struct rb_node *self, bool rebalance)
501 struct rb_node *father = RB_FATHER(self);
550 rb_tree_swap_prune_and_rebalance(struct rb_tree *rbt, struct rb_node *self,
551 struct rb_node *standin)
555 struct rb_node *standin_son;
556 struct rb_node *standin_father = RB_FATHER(standin);
703 rb_tree_prune_blackred_branch(struct rb_tree *rbt, struct rb_node *self,
706 struct rb_node *father = RB_FATHER(self);
707 struct rb_node *son = self->rb_nodes[which];
751 struct rb_node *standin, *self = RB_ITEMTONODE(rbto, object);
813 rb_tree_removal_rebalance(struct rb_tree *rbt, struct rb_node *parent,
823 struct rb_node *brother = parent->rb_nodes[other];
968 struct rb_node *self;
1013 static const struct rb_node *
1014 rb_tree_iterate_const(const struct rb_tree *rbt, const struct rb_node *self,
1060 rb_tree_count_black(const struct rb_node *self)
1076 rb_tree_check_node(const struct rb_tree *rbt, const struct rb_node *self,
1077 const struct rb_node *prev, bool red_check)
1093 KASSERT(RB_FATHER(self) == (const struct rb_node *) &rbt->rbt_root);
1114 const struct rb_node *prev0 = rb_tree_iterate_const(rbt, self, RB_DIR_LEFT);
1115 const struct rb_node *next0 = rb_tree_iterate_const(rbt, self, RB_DIR_RIGHT);
1132 const struct rb_node *brother;
1189 const struct rb_node *relative0, *relative;
1261 const struct rb_node *prev0;
1262 const struct rb_node *next0;
1280 const struct rb_node *self;
1281 const struct rb_node *prev;
1322 rb_tree_mark_depth(const struct rb_tree *rbt, const struct rb_node *self,