Lines Matching defs:root
48 static inline int radix_max(struct radix_tree_root *root) {
49 return (1 << (root->height * RADIX_TREE_MAP_SHIFT)) - 1;
57 radix_tree_lookup(struct radix_tree_root *root, unsigned long index) {
63 node = root->rnode;
64 height = root->height - 1;
65 if (index > radix_max(root))
76 radix_tree_delete(struct radix_tree_root *root, unsigned long index) {
84 node = root->rnode;
85 height = root->height - 1;
86 if (index > radix_max(root))
108 if (node == root->rnode) {
109 root->rnode = NULL;
110 root->height = 0;
120 int radix_tree_insert(struct radix_tree_root *root, unsigned long index,
131 /* get root node, if any */
132 node = root->rnode;
134 /* allocate root node, if any */
139 root->rnode = node;
140 root->height++;
144 while (radix_max(root) < index) {
146 if (root->height == RADIX_TREE_MAX_HEIGHT)
150 * If the root radix level is not empty, we need to
157 node->slots[0] = root->rnode;
159 root->rnode = node;
161 root->height++;
165 height = root->height - 1;
181 /* check if we should free the root node aswell */
182 if (root->rnode->count == 0) {
183 free(root->rnode);
184 root->rnode = NULL;
185 root->height = 0;