From patchwork Mon Jun 11 14:06:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 10458053 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5DF0A6020F for ; Mon, 11 Jun 2018 14:13:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E0ED28515 for ; Mon, 11 Jun 2018 14:13:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 49B3428445; Mon, 11 Jun 2018 14:13:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAD2B28606 for ; Mon, 11 Jun 2018 14:12:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E09526B02AC; Mon, 11 Jun 2018 10:07:19 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id DB7C16B02AF; Mon, 11 Jun 2018 10:07:19 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A04F36B02AD; Mon, 11 Jun 2018 10:07:19 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f198.google.com (mail-pf0-f198.google.com [209.85.192.198]) by kanga.kvack.org (Postfix) with ESMTP id 5D3226B02AC for ; Mon, 11 Jun 2018 10:07:19 -0400 (EDT) Received: by mail-pf0-f198.google.com with SMTP id j25-v6so9229490pfi.9 for ; Mon, 11 Jun 2018 07:07:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=h6tgGjkW1lxec/aGtQG6HYfrR+heEPK7J0OCaY70e34=; b=l+snk0ccdyKJ5v9pEFFUTT2AF84UklQmtX3ZRnMUEkYIvdZK27Jl6+TU92Z8HFBMOa gEp2N5JNSA61LFf5Uv235uWvvVe2s+pPpV+6SlEIcaaBjZcMoBO3VOqIXfwMCXGzEvKT lJXPYgT4lFGTKmEG0aNhFU1KF3ht8jui15S+5rpRIxNcWUd7QT9Svt/ub7MlXIjMhHW1 Wd3orzPeAWHNTjrjRV/OXekTWBr+CuA9FHApvmygohYds4QRoYGY9JU97q9YrhpKmpgp jBH954onll85Vp9+57yxQ1uaCIR6q0iwnDzh/5nBtS49M8pW39Dvztd5Ha8Rqdxe38lr 48FQ== X-Gm-Message-State: APt69E3+PwEt7UqafUkYVpzX5UJCaooAFpDj7WO1LbYSnq3p5XCTCxOw +LZS2BwgB5R/+qiCS+2Qd/Q6mRG0lcsbNETDJttB6+Oia+nsZWsdiupD4R66nYCBcw3fo6wSGmv HsHw6aCyMS5AvokpmXBgRiftlVwq5/zIPHaIPxxVyk/TWZV/6btBaGV0lRYC2i44JXw== X-Received: by 2002:aa7:85c9:: with SMTP id z9-v6mr17514611pfn.55.1528726039051; Mon, 11 Jun 2018 07:07:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ1Td/JIUWcJnfyeN5syc+X+V+z06QvCEzjHtIB296uTPDdUqAcb0lJV7cME3UnZMun8djL X-Received: by 2002:aa7:85c9:: with SMTP id z9-v6mr17514564pfn.55.1528726038242; Mon, 11 Jun 2018 07:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528726038; cv=none; d=google.com; s=arc-20160816; b=RueLMmeg+x+8MaH2lEjfAbKPsmd+C4IAcI90xIEeXU9PCTccVBE9PN4NiiAoVSypo+ a/CqNBspE85/h5TNMoyIuyr3Chy3zPQZCXZ2RmOf03GrFrJHpjDpMsK6Fp4cDBwnTbLT gi/JGrlGCtZYvfLz5ayKB3gQj2AzMXLKEYvTuZarVKVp1NXCXu9l2yv3YdBBtlucd3+H 1kIJOXZD8zxs0cp5RL/KFZxdR+a6ih3SVLqMNkMQ8W4daQiZ1dCIXIfH5RcpSytB+Nzj 6FuYLCxbf1BEt8+UFLjhsmDOGKfw0jI7dQwGBcMxfBYQjL0apcr8lUozClv1v2MAtvsE Yg7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=h6tgGjkW1lxec/aGtQG6HYfrR+heEPK7J0OCaY70e34=; b=kgKfxnl/q02sVEAPx/GUGNaby6JW8EsTGRbzjG2BojHaEBosCoxNZniblEBPxOUWgu MfrYHeS2seuFkxnZGs8UUpm7kbs/C6SgGA9XaQ6LSzBecx6KYbsxhjBw87VURRC2Ux9K anz0MXA3VDUzFb8YKNOcGZ7W29UyRMj5X+ZaTueDLXqTtrL60/Sxjly6JQgjIKyhsLgu wYdpbehi+8bTIiOekXjlEPD+TCU7rysJNKDE/BkKS9Hc/1S+Q/zhvGAZu5HSNXEwMtM7 MK7zH1agPWAQRB9yP5hUaFBRCBtxvnNO2vKJfrSlcxaNTMCX1pnn5lVg7K4czWAjBvjo LC8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=KLtue/SJ; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id o3-v6si63464941pld.50.2018.06.11.07.07.18 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Jun 2018 07:07:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=KLtue/SJ; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=h6tgGjkW1lxec/aGtQG6HYfrR+heEPK7J0OCaY70e34=; b=KLtue/SJDu9kU71yyaOVze26o bC5ou7VhCRkLWjhI5Z+ImhqYog6fWqVOTdYslr/F4qk1/vbkXEhID/dq3p9Mi6RvlWBY3jQdNn3Jf k0JZXR3mG78zda53jqdL96oGZBwGjGG5TxOE0XD7lKkMikFiptFSKLzTv3izy4znUBpvYfxXdu2LX ognZ8Y/0H85vAWmZ6mSvj9BGHG3Q263nyUJKmgzUSrHD+mZ/GDBV1uMEtW3/tVTRaExJTWzxwx7S7 WbWUoK0KoSK6zRaqr6WPsvU6W/IAJe5YoBwutHYvN62e69I0RsOM3jDcNFF2/D5vrp5t9eaqEkoy+ Z3BiBETjQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fSNTZ-00056G-4B; Mon, 11 Jun 2018 14:07:17 +0000 From: Matthew Wilcox To: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Matthew Wilcox , Jan Kara , Jeff Layton , Lukas Czerner , Ross Zwisler , Christoph Hellwig , Goldwyn Rodrigues , Nicholas Piggin , Ryusuke Konishi , linux-nilfs@vger.kernel.org, Jaegeuk Kim , Chao Yu , linux-f2fs-devel@lists.sourceforge.net Subject: [PATCH v13 72/72] radix tree: Remove radix_tree_clear_tags Date: Mon, 11 Jun 2018 07:06:39 -0700 Message-Id: <20180611140639.17215-73-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180611140639.17215-1-willy@infradead.org> References: <20180611140639.17215-1-willy@infradead.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Matthew Wilcox The page cache was the only user of this interface and it has now been converted to the XArray. Transform the test into a test of xas_init_tags(). Signed-off-by: Matthew Wilcox --- include/linux/radix-tree.h | 2 -- lib/radix-tree.c | 13 ----------- tools/testing/radix-tree/tag_check.c | 32 +++++++++++++--------------- 3 files changed, 15 insertions(+), 32 deletions(-) diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index f8ef267e4975..27c15990951d 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h @@ -252,8 +252,6 @@ void radix_tree_iter_delete(struct radix_tree_root *, struct radix_tree_iter *iter, void __rcu **slot); void *radix_tree_delete_item(struct radix_tree_root *, unsigned long, void *); void *radix_tree_delete(struct radix_tree_root *, unsigned long); -void radix_tree_clear_tags(struct radix_tree_root *, struct radix_tree_node *, - void __rcu **slot); unsigned int radix_tree_gang_lookup(const struct radix_tree_root *, void **results, unsigned long first_index, unsigned int max_items); diff --git a/lib/radix-tree.c b/lib/radix-tree.c index ad03dc0c562f..101f1c28e1b6 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -1711,19 +1711,6 @@ void *radix_tree_delete(struct radix_tree_root *root, unsigned long index) } EXPORT_SYMBOL(radix_tree_delete); -void radix_tree_clear_tags(struct radix_tree_root *root, - struct radix_tree_node *node, - void __rcu **slot) -{ - if (node) { - unsigned int tag, offset = get_slot_offset(node, slot); - for (tag = 0; tag < RADIX_TREE_MAX_TAGS; tag++) - node_tag_clear(root, node, tag, offset); - } else { - root_tag_clear_all(root); - } -} - /** * radix_tree_tagged - test whether any items in the tree are tagged * @root: radix tree root diff --git a/tools/testing/radix-tree/tag_check.c b/tools/testing/radix-tree/tag_check.c index 543181e4847b..340bc4f72f34 100644 --- a/tools/testing/radix-tree/tag_check.c +++ b/tools/testing/radix-tree/tag_check.c @@ -331,29 +331,27 @@ static void single_check(void) item_kill_tree(&tree); } -void radix_tree_clear_tags_test(void) +void init_tags_test(void) { + DEFINE_XARRAY(tree); + XA_STATE(xas, &tree, 0); unsigned long index; - struct radix_tree_node *node; - struct radix_tree_iter iter; - void **slot; + void *entry; - RADIX_TREE(tree, GFP_KERNEL); - - item_insert(&tree, 0); - item_tag_set(&tree, 0, 0); - __radix_tree_lookup(&tree, 0, &node, &slot); - radix_tree_clear_tags(&tree, node, slot); - assert(item_tag_get(&tree, 0, 0) == 0); + xa_store(&tree, 0, xa_mk_value(0), GFP_KERNEL); + item_tag_set(&tree, 0, XA_TAG_0); + xas_load(&xas); + xas_init_tags(&xas); + assert(item_tag_get(&tree, 0, XA_TAG_0) == 0); for (index = 0; index < 1000; index++) { - item_insert(&tree, index); - item_tag_set(&tree, index, 0); + xa_store(&tree, index, xa_mk_value(index), GFP_KERNEL); + item_tag_set(&tree, index, XA_TAG_0); } - radix_tree_for_each_slot(slot, &tree, &iter, 0) { - radix_tree_clear_tags(&tree, iter.node, slot); - assert(item_tag_get(&tree, iter.index, 0) == 0); + xas_for_each(&xas, entry, ULONG_MAX) { + xas_init_tags(&xas); + assert(item_tag_get(&tree, xas.xa_index, XA_TAG_0) == 0); } item_kill_tree(&tree); @@ -376,5 +374,5 @@ void tag_check(void) thrash_tags(); rcu_barrier(); printv(2, "after thrash_tags: %d allocated\n", nr_allocated); - radix_tree_clear_tags_test(); + init_tags_test(); }