aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@linux.intel.com>2016-05-20 20:03:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-20 20:58:30 -0400
commitaf49a63e101eb62376cc1d6bd25b97eb8c691d54 (patch)
tree14de8f15220ce87338d543790baaeac39dece79d /lib
parentb194d16c27af905d6e3552f4851bc7d9fee4e90f (diff)
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)
1395 bool shrunk = false; 1395 bool shrunk = false;
1396 1396
1397 for (;;) { 1397 for (;;) {
1398 struct radix_tree_node *to_free = root->rnode; 1398 struct radix_tree_node *node = root->rnode;
1399 struct radix_tree_node *slot; 1399 struct radix_tree_node *child;
1400 1400
1401 if (!radix_tree_is_internal_node(to_free)) 1401 if (!radix_tree_is_internal_node(node))
1402 break; 1402 break;
1403 to_free = entry_to_node(to_free); 1403 node = entry_to_node(node);
1404 1404
1405 /* 1405 /*
1406 * The candidate node has more than one child, or its child 1406 * The candidate node has more than one child, or its child
1407 * is not at the leftmost slot, or the child is a multiorder 1407 * is not at the leftmost slot, or the child is a multiorder
1408 * entry, we cannot shrink. 1408 * entry, we cannot shrink.
1409 */ 1409 */
1410 if (to_free->count != 1) 1410 if (node->count != 1)
1411 break; 1411 break;
1412 slot = to_free->slots[0]; 1412 child = node->slots[0];
1413 if (!slot) 1413 if (!child)
1414 break; 1414 break;
1415 if (!radix_tree_is_internal_node(slot) && to_free->shift) 1415 if (!radix_tree_is_internal_node(child) && node->shift)
1416 break; 1416 break;
1417 1417
1418 if (radix_tree_is_internal_node(slot)) 1418 if (radix_tree_is_internal_node(child))
1419 entry_to_node(slot)->parent = NULL; 1419 entry_to_node(child)->parent = NULL;
1420 1420
1421 /* 1421 /*
1422 * We don't need rcu_assign_pointer(), since we are simply 1422 * We don't need rcu_assign_pointer(), since we are simply
1423 * moving the node from one part of the tree to another: if it 1423 * moving the node from one part of the tree to another: if it
1424 * was safe to dereference the old pointer to it 1424 * was safe to dereference the old pointer to it
1425 * (to_free->slots[0]), it will be safe to dereference the new 1425 * (node->slots[0]), it will be safe to dereference the new
1426 * one (root->rnode) as far as dependent read barriers go. 1426 * one (root->rnode) as far as dependent read barriers go.
1427 */ 1427 */
1428 root->rnode = slot; 1428 root->rnode = child;
1429 1429
1430 /* 1430 /*
1431 * We have a dilemma here. The node's slot[0] must not be 1431 * 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)
1445 * also results in a stale slot). So tag the slot as indirect 1445 * also results in a stale slot). So tag the slot as indirect
1446 * to force callers to retry. 1446 * to force callers to retry.
1447 */ 1447 */
1448 if (!radix_tree_is_internal_node(slot)) 1448 if (!radix_tree_is_internal_node(child))
1449 to_free->slots[0] = RADIX_TREE_RETRY; 1449 node->slots[0] = RADIX_TREE_RETRY;
1450 1450
1451 radix_tree_node_free(to_free); 1451 radix_tree_node_free(node);
1452 shrunk = true; 1452 shrunk = true;
1453 } 1453 }
1454 1454