Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932422AbcDNOiQ (ORCPT ); Thu, 14 Apr 2016 10:38:16 -0400 Received: from mga02.intel.com ([134.134.136.20]:36030 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932292AbcDNOiK (ORCPT ); Thu, 14 Apr 2016 10:38:10 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,485,1455004800"; d="scan'208";a="945178743" From: Matthew Wilcox To: linux-kernel@vger.kernel.org, Andrew Morton Cc: Matthew Wilcox , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Konstantin Khlebnikov , Kirill Shutemov , Jan Kara , Neil Brown , Ross Zwisler Subject: [PATCH 12/19] radix-tree: Change naming conventions in radix_tree_shrink Date: Thu, 14 Apr 2016 10:37:15 -0400 Message-Id: <1460644642-30642-13-git-send-email-willy@linux.intel.com> X-Mailer: git-send-email 2.8.0.rc3 In-Reply-To: <1460644642-30642-1-git-send-email-willy@linux.intel.com> References: <1460644642-30642-1-git-send-email-willy@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2430 Lines: 77 Use the more standard 'node' and 'child' instead of 'to_free' and 'slot'. Signed-off-by: Matthew Wilcox --- lib/radix-tree.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/radix-tree.c b/lib/radix-tree.c index 145dcb1..094dfc0 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -1396,37 +1396,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 @@ -1446,10 +1446,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; } -- 2.8.0.rc3