Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424337AbcKPWmW (ORCPT ); Wed, 16 Nov 2016 17:42:22 -0500 Received: from p3plsmtps2ded02.prod.phx3.secureserver.net ([208.109.80.59]:59526 "EHLO p3plsmtps2ded02.prod.phx3.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S940575AbcKPWfY (ORCPT ); Wed, 16 Nov 2016 17:35:24 -0500 x-originating-ip: 72.167.245.219 From: Matthew Wilcox To: linux-kernel@vger.kernel.org, Andrew Morton , Konstantin Khlebnikov , Ross Zwisler Cc: linux-fsdevel@vger.kernel.org, Matthew Wilcox , linux-mm@kvack.org, "Kirill A . Shutemov" Subject: [PATCH 28/29] radix-tree: Create all_tag_set Date: Wed, 16 Nov 2016 16:17:35 -0800 Message-Id: <1479341856-30320-71-git-send-email-mawilcox@linuxonhyperv.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1479341856-30320-1-git-send-email-mawilcox@linuxonhyperv.com> References: <1479341856-30320-1-git-send-email-mawilcox@linuxonhyperv.com> X-CMAE-Envelope: MS4wfC7gyTSeBxx+x4f2XL9XwexeU1IrJs4MMrfTSoDLLEB7MYdCsaqYWRCfdzZaGx67u9KAKrpDFT3rcTAG2kVFZJ5lRYc3N4sSyNC/CpSWb5PmkSJ4QHHq dmYPJqPM9lJh475rX7Ww8k5HcsQ7PlbZKHpzJn0CGefKRvoqfdMJysusIIFbD7Go3R1cllGS+wV2MK42gJkl0zh0o0PVMSXaJpwpYjzQO6W/02ucnqAJIFKw lnymGa0KQR5crmc8OplxRhqui7ZJ1aFPDxuNa0vAptuJ/htJLZpTykxtRyWp+C72ZG0O4dRV0w9szERz0dLOPnu3KzNpgb5zGk2klrQlf+j1TkmcQikCWKhD 4vrbz0CzwJv5aYtNXcqhFqfvwpDxqCGGvcd3IUqs2Vrp6ABUyozkC9r19DXfyKvUktI7xdU+i1hKtwGKHXrFccA2oxfo8/UbH+WDDfxwkVmy/+sQ/lg= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1218 Lines: 45 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 c8ef657..e063ca2 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