Lines Matching defs:root
68 RB_EMPTY_ROOT(const struct rb_root *root)
71 return RB_TREE_MIN(__UNCONST(&root->rbr_tree)) == NULL;
75 rb_first(const struct rb_root *root)
77 char *vnode = RB_TREE_MIN(__UNCONST(&root->rbr_tree));
80 vnode += root->rbr_tree.rbt_ops->rbto_node_offset;
85 rb_next2(const struct rb_root *root, const struct rb_node *rbnode)
89 vnode -= root->rbr_tree.rbt_ops->rbto_node_offset;
90 vnode = RB_TREE_NEXT(__UNCONST(&root->rbr_tree), vnode);
92 vnode += root->rbr_tree.rbt_ops->rbto_node_offset;
97 rb_last(const struct rb_root *root)
99 char *vnode = RB_TREE_MAX(__UNCONST(&root->rbr_tree));
102 vnode += root->rbr_tree.rbt_ops->rbto_node_offset;
107 rb_first_cached(const struct rb_root_cached *root)
109 return rb_first(&root->rb_root);
113 rb_erase(struct rb_node *rbnode, struct rb_root *root)
115 struct rb_tree *tree = &root->rbr_tree;
122 rb_erase_cached(struct rb_node *rbnode, struct rb_root_cached *root)
124 rb_erase(rbnode, &root->rb_root);
128 rb_replace_node(struct rb_node *old, struct rb_node *new, struct rb_root *root)
130 void *vold = (char *)old - root->rbr_tree.rbt_ops->rbto_node_offset;
131 void *vnew = (char *)new - root->rbr_tree.rbt_ops->rbto_node_offset;
134 rb_tree_remove_node(&root->rbr_tree, vold);
135 collision = rb_tree_insert_node(&root->rbr_tree, vnew);
141 struct rb_root_cached *root)
143 rb_replace_node(old, new, &root->rb_root);
152 rb_first_postorder(const struct rb_root *root)
156 if ((node = root->rbr_tree.rbt_root) == NULL)
168 rb_next2_postorder(const struct rb_root *root, struct rb_node *node)
176 * If we're at the root, there are no more siblings and no
179 if (RB_ROOT_P(&root->rbr_tree, node))
213 struct rb_node *root;
217 if ((root = to->rbr_tree.rbt_root) == NULL)
221 * The root node's `parent' is a strict-aliasing-unsafe hack
222 * pointing at the root of the tree.
224 RB_SET_FATHER(root, (struct rb_node *)(void *)&to->rbr_tree.rbt_root);
227 #define rbtree_postorder_for_each_entry_safe(ENTRY, TMP, ROOT, FIELD) \
228 for ((ENTRY) = rb_entry_safe(rb_first_postorder(ROOT), \
231 ((TMP) = rb_entry_safe(rb_next2_postorder((ROOT), \