Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1167022rwd; Tue, 16 May 2023 12:51:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4cLMWGxiMKk0Y2faWXfVcjgi3JJh6ujT/zDnsftamYpS6R6KIYezbZm+28Z/ftHW04gaNx X-Received: by 2002:a05:6a21:339f:b0:101:6f60:120f with SMTP id yy31-20020a056a21339f00b001016f60120fmr33595400pzb.39.1684266694649; Tue, 16 May 2023 12:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684266694; cv=none; d=google.com; s=arc-20160816; b=RmiLnG98ArvhQLNCWP29rSq8QIP6GNa4LRhyhpyfX0WSJpp+odD4DnhBkgLKXEVfFS 736eSMH9VZAN8zJY9+pfD36qrM5UVXvTx0GWyPO2MfagavA0Nx+18g4QaEkOh5+qKANL YO1X+jwMNi+qztXtIFGf06b7VZ8/ZgJulKIWvoTOz+0fKASpkSWNZ908W9tl6+/53xvX gTJU9pzs3K6ndRH9C9d6kbC/AYn5jCEzWrcmnH/AMOm7dmMZHVdMLX4ChzAmOp2kj1CT mz+PQeVrecBGJBJLcBTE+ei9RVK2dQSS5gM34eNOPOSOG5YDlyKPofB3ErMYDpdSsjow vYJg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bs9-20020a632809000000b0052c910d862fsi18409664pgb.244.2023.05.16.12.51.22; Tue, 16 May 2023 12:51:34 -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 S230051AbjEPTmk (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 Content-Transfer-Encoding: 8bit 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 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) -- 2.39.2