if (is_sibling_entry(node, entry)) {
pr_debug("radix sblng %p offset %ld val %p indices %ld-%ld\n",
entry, i,
- *(void **)indirect_to_ptr(entry),
+ *(void **)entry_to_node(entry),
first, last);
} else if (!radix_tree_is_indirect_ptr(entry)) {
pr_debug("radix entry %p offset %ld indices %ld-%ld\n",
entry, i, first, last);
} else {
- dump_node(indirect_to_ptr(entry), first);
+ dump_node(entry_to_node(entry), first);
}
}
}
root->gfp_mask >> __GFP_BITS_SHIFT);
if (!radix_tree_is_indirect_ptr(root->rnode))
return;
- dump_node(indirect_to_ptr(root->rnode), 0);
+ dump_node(entry_to_node(root->rnode), 0);
}
#endif
*nodep = node;
if (likely(radix_tree_is_indirect_ptr(node))) {
- node = indirect_to_ptr(node);
+ node = entry_to_node(node);
*maxindex = node_maxindex(node);
return node->shift + RADIX_TREE_MAP_SHIFT;
}
node->offset = 0;
node->count = 1;
node->parent = NULL;
- if (radix_tree_is_indirect_ptr(slot)) {
- slot = indirect_to_ptr(slot);
- slot->parent = node;
- slot = node_to_entry(slot);
- }
+ if (radix_tree_is_indirect_ptr(slot))
+ entry_to_node(slot)->parent = node;
node->slots[0] = slot;
slot = node_to_entry(node);
rcu_assign_pointer(root->rnode, slot);
break;
/* Go a level down */
- node = indirect_to_ptr(slot);
+ node = entry_to_node(slot);
offset = (index >> shift) & RADIX_TREE_MAP_MASK;
offset = radix_tree_descend(node, &slot, offset);
}
if (node == RADIX_TREE_RETRY)
goto restart;
- parent = indirect_to_ptr(node);
+ parent = entry_to_node(node);
shift -= RADIX_TREE_MAP_SHIFT;
offset = (index >> shift) & RADIX_TREE_MAP_MASK;
offset = radix_tree_descend(parent, &node, offset);
shift -= RADIX_TREE_MAP_SHIFT;
offset = (index >> shift) & RADIX_TREE_MAP_MASK;
- parent = indirect_to_ptr(node);
+ parent = entry_to_node(node);
offset = radix_tree_descend(parent, &node, offset);
BUG_ON(!node);
shift -= RADIX_TREE_MAP_SHIFT;
offset = (index >> shift) & RADIX_TREE_MAP_MASK;
- parent = indirect_to_ptr(node);
+ parent = entry_to_node(node);
offset = radix_tree_descend(parent, &node, offset);
}
shift -= RADIX_TREE_MAP_SHIFT;
offset = (index >> shift) & RADIX_TREE_MAP_MASK;
- parent = indirect_to_ptr(node);
+ parent = entry_to_node(node);
offset = radix_tree_descend(parent, &node, offset);
if (!node)
return NULL;
if (radix_tree_is_indirect_ptr(rnode)) {
- rnode = indirect_to_ptr(rnode);
+ rnode = entry_to_node(rnode);
} else if (rnode) {
/* Single-slot tree */
iter->index = index;
if (!radix_tree_is_indirect_ptr(slot))
break;
- node = indirect_to_ptr(slot);
+ node = entry_to_node(slot);
shift -= RADIX_TREE_MAP_SHIFT;
offset = (index >> shift) & RADIX_TREE_MAP_MASK;
}
return 1;
}
- node = indirect_to_ptr(slot);
+ node = entry_to_node(slot);
shift -= RADIX_TREE_MAP_SHIFT;
for (;;) {
goto next;
/* Sibling slots never have tags set on them */
if (radix_tree_is_indirect_ptr(slot)) {
- node = indirect_to_ptr(slot);
+ node = entry_to_node(slot);
shift -= RADIX_TREE_MAP_SHIFT;
continue;
}
}
continue;
}
- node = indirect_to_ptr(node);
+ node = entry_to_node(node);
if (is_sibling_entry(slot, node))
continue;
slot = node;
break;
}
- node = indirect_to_ptr(node);
+ node = entry_to_node(node);
max_index = node_maxindex(node);
if (cur_index > max_index) {
if (!radix_tree_is_indirect_ptr(to_free))
break;
- to_free = indirect_to_ptr(to_free);
+ to_free = entry_to_node(to_free);
/*
* The candidate node has more than one child, or its child
if (!radix_tree_is_indirect_ptr(slot) && to_free->shift)
break;
- if (radix_tree_is_indirect_ptr(slot)) {
- slot = indirect_to_ptr(slot);
- slot->parent = NULL;
- slot = node_to_entry(slot);
- }
+ if (radix_tree_is_indirect_ptr(slot))
+ entry_to_node(slot)->parent = NULL;
/*
* We don't need rcu_assign_pointer(), since we are simply
struct radix_tree_node *parent;
if (node->count) {
- if (node == indirect_to_ptr(root->rnode))
+ if (node == entry_to_node(root->rnode))
deleted |= radix_tree_shrink(root);
return deleted;
}