From patchwork Tue May 16 19:41:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 94901 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp671898vqo; Tue, 16 May 2023 13:05:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72eDQ28ecL4vyJ8prSEEE1IOsEvvTJL2ecJGT+NwkJTktzvuhmm0SpjY2YH1v0ptQWzTe9 X-Received: by 2002:a05:6808:199f:b0:396:12ba:f9d3 with SMTP id bj31-20020a056808199f00b0039612baf9d3mr3864828oib.25.1684267524175; Tue, 16 May 2023 13:05:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684267524; cv=none; d=google.com; s=arc-20160816; b=jDNmyQ0jThPT2+1fk+xhnPCzQD7eoRYVrieCANvKtXtwKbNOUF2a5mFN9BOTru6Gdw e9vOWdVr+MI98+AWSD5oIxptXrwBj+7CkDxkGFDPb+pvzEL9jENpcHn2nqHg4x5FsjtC G9bk/H8JdcijTlgkRbHYPgkk7DwMNoZbIFYRc9Mi1WfWNIQjjAWOEB28OHigt18fjSfX i1eeaaJuRpZUGw2jT3I+euxQ3KqLBQ8vontbHbYdMjNIdwBVKo+3dv3qzDywEfNasp11 qfh6687sLel6eVC6crVBZpWpNAhr1tfVlceseOp6ALLlPriLD2ye/fbM769ofFEN4+Os ZQdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=9uxvSZFxDAkofez+LopL5+cFtdUfj5srk7J/09vvscw=; b=HQy7MmEPKoewpoj9yP5iUwpW0PYfUzn5xCp+tQTLfLnDadZaX7Hq1x4eblXxb9tKD0 I/VfBaBiuoxBtaYS97Uu9+2ZVT1U0HCATny1nHzMuw1DWlW+a8eN/os8pdx9W6g6Atbk 3eEo58H36Y4JuPn5hLxYwYp1XftXWIMYML5+DaX8vYWhV/uLTaODBPLPbPd/bozu+fjz xlYyQze1smXjoK0LtaZk1D49SgMzppJhzEjCEixrrXqQLrooId3hBYqQNQP+GN5fWaW5 a7nxs6kSeEd/favgH3U2yhvMAEMRSppAcLMJAPfGfE4ywc5yc0Sqf8BPmuuYy4IhK/Eq tR7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sGA1G0BI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v4-20020acade04000000b003877dc1c2b6si12167270oig.325.2023.05.16.13.04.55; Tue, 16 May 2023 13:05:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sGA1G0BI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229464AbjEPTmk (ORCPT + 99 others); Tue, 16 May 2023 15:42:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229938AbjEPTmc (ORCPT ); Tue, 16 May 2023 15:42:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 540BC76AF; Tue, 16 May 2023 12:42:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CDD426340C; Tue, 16 May 2023 19:42:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01CDFC433D2; Tue, 16 May 2023 19:42:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684266139; bh=5lvCP4bPSOrgTZv7kSqqa1Lk3TnQEcnuBUwkjntOlBw=; h=From:To:Cc:Subject:Date:From; b=sGA1G0BIX4VM0STtkY1VwQj3jrY3tVJHulInpr9gDGJUF3jOd3lNFrcIrzwM8ugtV RLRTSLD+ZcLMVVbOOvjSh2l+22yPCuJtPOID4cM1qUW0n06BMh5n9BCV8HYAqiTQDW wxN81EThZVxFIn9XWcHduKuVkBLdLH2mJkdJ9WjIPTcxgLhz2rEhP8Nw01l2iPsX20 V/qDU83w4Pbp9H+7FZPij4usjaOYHce36PuZL/5ZPOpPeT5t7idjpHkPbLE7ZcNKI8 G6UkDWbj5r97z28djwWHPSVAFXd+cKnmrbiSizfpZTJ/YzEGVu/1ko4r/2jn2wDfNk kAkjc2JXeL9ig== From: Arnd Bergmann To: Matthew Wilcox Cc: Arnd Bergmann , Andrew Morton , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH] radix-tree: move declarations to header Date: Tue, 16 May 2023 21:41:54 +0200 Message-Id: <20230516194212.548910-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766082503648680440?= X-GMAIL-MSGID: =?utf-8?q?1766082503648680440?= From: Arnd Bergmann The xarray.c file contains the only call to radix_tree_node_rcu_free(), and it comes with its own extern declaration for it. This means the function definition causes a missing-prototype warning: lib/radix-tree.c:288:6: error: no previous prototype for 'radix_tree_node_rcu_free' [-Werror=missing-prototypes] Instead, move the declaration for this function to a new header that can be included by both, and do the same for the radix_tree_node_cachep variable that has the same underlying problem but does not cause a warning with gcc. Signed-off-by: Arnd Bergmann --- lib/radix-tree.c | 2 ++ lib/radix-tree.h | 8 ++++++++ lib/xarray.c | 6 ++---- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 lib/radix-tree.h diff --git a/lib/radix-tree.c b/lib/radix-tree.c index 049ba132f7ef..1a31065b2036 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -27,6 +27,8 @@ #include #include +#include "radix-tree.h" + /* * Radix tree node cache. */ diff --git a/lib/radix-tree.h b/lib/radix-tree.h new file mode 100644 index 000000000000..40d5c03e2b09 --- /dev/null +++ b/lib/radix-tree.h @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* radix-tree helpers that are only shared with xarray */ + +struct kmem_cache; +struct rcu_head; + +extern struct kmem_cache *radix_tree_node_cachep; +extern void radix_tree_node_rcu_free(struct rcu_head *head); diff --git a/lib/xarray.c b/lib/xarray.c index ea9ce1f0b386..2071a3718f4e 100644 --- a/lib/xarray.c +++ b/lib/xarray.c @@ -12,6 +12,8 @@ #include #include +#include "radix-tree.h" + /* * Coding conventions in this file: * @@ -247,10 +249,6 @@ void *xas_load(struct xa_state *xas) } EXPORT_SYMBOL_GPL(xas_load); -/* Move the radix tree node cache here */ -extern struct kmem_cache *radix_tree_node_cachep; -extern void radix_tree_node_rcu_free(struct rcu_head *head); - #define XA_RCU_FREE ((struct xarray *)1) static void xa_node_free(struct xa_node *node)