From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from p3plsmtps2ded02.prod.phx3.secureserver.net ([208.109.80.59]:59496 "EHLO p3plsmtps2ded02.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754026AbcKPWfU (ORCPT ); Wed, 16 Nov 2016 17:35:20 -0500 From: Matthew Wilcox Cc: linux-fsdevel@vger.kernel.org, Matthew Wilcox Subject: [PATCH 27/28] radix-tree: Create all_tag_set Date: Wed, 16 Nov 2016 16:17:32 -0800 Message-Id: <1479341856-30320-68-git-send-email-mawilcox@linuxonhyperv.com> In-Reply-To: <1479341856-30320-1-git-send-email-mawilcox@linuxonhyperv.com> References: <1479341856-30320-1-git-send-email-mawilcox@linuxonhyperv.com> To: unlisted-recipients:; (no To-header on input) Sender: linux-fsdevel-owner@vger.kernel.org List-ID: From: Matthew Wilcox all_tag_set() sets every tag on a node. This is useful for the IDR code when we're creating new nodes which contain only free slots. Signed-off-by: Matthew Wilcox --- lib/radix-tree.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/radix-tree.c b/lib/radix-tree.c index 720b4c5..1bd5df8 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -22,6 +22,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include +#include #include #include #include @@ -33,7 +35,6 @@ #include #include #include -#include #include #include /* in_interrupt() */ @@ -184,6 +185,11 @@ static inline int any_tag_set(struct radix_tree_node *node, unsigned int tag) return 0; } +static inline void all_tag_set(struct radix_tree_node *node, unsigned int tag) +{ + bitmap_fill(node->tags[tag], RADIX_TREE_MAP_SIZE); +} + /** * radix_tree_find_next_bit - find the next set bit in a memory region * -- 2.10.2