summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@linux.intel.com>2016-05-20 17:03:33 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-20 17:58:30 -0700
commitaf49a63e101eb62376cc1d6bd25b97eb8c691d54 (patch)
tree14de8f15220ce87338d543790baaeac39dece79d /lib
parentb194d16c27af905d6e3552f4851bc7d9fee4e90f (diff)
downloadlinux-rt-af49a63e101eb62376cc1d6bd25b97eb8c691d54.tar.gz
radix-tree: change naming conventions in radix_tree_shrink
Use the more standard 'node' and 'child' instead of 'to_free' and 'slot'. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Cc: Konstantin Khlebnikov <koct9i@gmail.com> Cc: Kirill Shutemov <kirill.shutemov@linux.intel.com> Cc: Jan Kara <jack@suse.com> Cc: Neil Brown <neilb@suse.de> Cc: Ross Zwisler <ross.zwisler@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/radix-tree.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index b65c83036ca4..4b4a2a20a3d1 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -1395,37 +1395,37 @@ static inline bool radix_tree_shrink(struct radix_tree_root *root)
bool shrunk = false;
for (;;) {
- struct radix_tree_node *to_free = root->rnode;
- struct radix_tree_node *slot;
+ struct radix_tree_node *node = root->rnode;
+ struct radix_tree_node *child;
- if (!radix_tree_is_internal_node(to_free))
+ if (!radix_tree_is_internal_node(node))
break;
- to_free = entry_to_node(to_free);
+ node = entry_to_node(node);
/*
* The candidate node has more than one child, or its child
* is not at the leftmost slot, or the child is a multiorder
* entry, we cannot shrink.
*/
- if (to_free->count != 1)
+ if (node->count != 1)
break;
- slot = to_free->slots[0];
- if (!slot)
+ child = node->slots[0];
+ if (!child)
break;
- if (!radix_tree_is_internal_node(slot) && to_free->shift)
+ if (!radix_tree_is_internal_node(child) && node->shift)
break;
- if (radix_tree_is_internal_node(slot))
- entry_to_node(slot)->parent = NULL;
+ if (radix_tree_is_internal_node(child))
+ entry_to_node(child)->parent = NULL;
/*
* We don't need rcu_assign_pointer(), since we are simply
* moving the node from one part of the tree to another: if it
* was safe to dereference the old pointer to it
- * (to_free->slots[0]), it will be safe to dereference the new
+ * (node->slots[0]), it will be safe to dereference the new
* one (root->rnode) as far as dependent read barriers go.
*/
- root->rnode = slot;
+ root->rnode = child;
/*
* We have a dilemma here. The node's slot[0] must not be
@@ -1445,10 +1445,10 @@ static inline bool radix_tree_shrink(struct radix_tree_root *root)
* also results in a stale slot). So tag the slot as indirect
* to force callers to retry.
*/
- if (!radix_tree_is_internal_node(slot))
- to_free->slots[0] = RADIX_TREE_RETRY;
+ if (!radix_tree_is_internal_node(child))
+ node->slots[0] = RADIX_TREE_RETRY;
- radix_tree_node_free(to_free);
+ radix_tree_node_free(node);
shrunk = true;
}