From patchwork Sat Mar 11 23:39:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13171047 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00C87C7618A for ; Sat, 11 Mar 2023 23:40:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229772AbjCKXkA (ORCPT ); Sat, 11 Mar 2023 18:40:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbjCKXjy (ORCPT ); Sat, 11 Mar 2023 18:39:54 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BAD23669B; Sat, 11 Mar 2023 15:39:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=NyzvMGDdE58I8HPSATmgnyV0KqBaQSH9+ozf8EmTmiA=; b=oS4yMIs9QRvW/zUO51HWEeG4Rn V/4cVRVP0y3c8hrggtZfRj+HZNPddfYXEsV1xyx3i4GTwBGasNbuXvw8m7LChPeXOU8FR/OSRohME Y7B/+oPcwEnz7KNfUtct3ARK8lVkBQqTiYdEOtwZkyUsFVY9MlEmD/piiGsoYFdZM0t2MW50Wv6wF 1hyqhaFGjiLNF9YZlMbIPStiOAOK9IlJ7S8qy+sclXlow4RTh6ZOYYCzag3PXlQGdnvkjtVTg6jH8 jZAuV4hfi09B1FbGmgFGN459kfvV60lGo9oItn1cYoJQ0ssPj9qaba0ekXCpsChJI0yVZNRhCBjfn jS3y/hDg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pb8oT-001UJo-3W; Sat, 11 Mar 2023 23:39:45 +0000 From: Luis Chamberlain To: chuck.lever@oracle.com, jlayton@kernel.org, trond.myklebust@hammerspace.com, anna@kernel.org, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, kuba@kernel.org, linux-nfs@vger.kernel.org Cc: ebiederm@xmission.com, keescook@chromium.org, yzaikin@google.com, j.granados@samsung.com, patches@lists.linux.dev, linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Luis Chamberlain Subject: [PATCH v3 4/5] sunrpc: move sunrpc_table and proc routines above Date: Sat, 11 Mar 2023 15:39:43 -0800 Message-Id: <20230311233944.354858-5-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230311233944.354858-1-mcgrof@kernel.org> References: <20230311233944.354858-1-mcgrof@kernel.org> MIME-Version: 1.0 Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org No need to do a forward declaration for sunrpc_table, just move the sysctls up as everyone else does it. This will make the next change easier to read. This change produces no functional changes. Signed-off-by: Luis Chamberlain --- net/sunrpc/sysctl.c | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c index 3aad6ef18504..afdfcc5403af 100644 --- a/net/sunrpc/sysctl.c +++ b/net/sunrpc/sysctl.c @@ -40,25 +40,6 @@ EXPORT_SYMBOL_GPL(nlm_debug); #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) -static struct ctl_table_header *sunrpc_table_header; -static struct ctl_table sunrpc_table[]; - -void -rpc_register_sysctl(void) -{ - if (!sunrpc_table_header) - sunrpc_table_header = register_sysctl_table(sunrpc_table); -} - -void -rpc_unregister_sysctl(void) -{ - if (sunrpc_table_header) { - unregister_sysctl_table(sunrpc_table_header); - sunrpc_table_header = NULL; - } -} - static int proc_do_xprt(struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos) { @@ -142,6 +123,7 @@ proc_dodebug(struct ctl_table *table, int write, void *buffer, size_t *lenp, return 0; } +static struct ctl_table_header *sunrpc_table_header; static struct ctl_table debug_table[] = { { @@ -190,4 +172,19 @@ static struct ctl_table sunrpc_table[] = { { } }; +void +rpc_register_sysctl(void) +{ + if (!sunrpc_table_header) + sunrpc_table_header = register_sysctl_table(sunrpc_table); +} + +void +rpc_unregister_sysctl(void) +{ + if (sunrpc_table_header) { + unregister_sysctl_table(sunrpc_table_header); + sunrpc_table_header = NULL; + } +} #endif