From patchwork Sat Mar 11 20:51:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Luis R. Rodriguez" X-Patchwork-Id: 13170992 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 2EFDFC6FD1C for ; Sat, 11 Mar 2023 20:52:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229954AbjCKUwJ (ORCPT ); Sat, 11 Mar 2023 15:52:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229897AbjCKUwF (ORCPT ); Sat, 11 Mar 2023 15:52:05 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3FF26B5C5; Sat, 11 Mar 2023 12:52:01 -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=uVA5gkd7agM5XGy1IcOl4n0Hi/2VsqP4CuIiylpH99w=; b=2sfCSCCSYqnla7r5cEbjLxX5XG mWPsPA4I5aYIaO0CQoU/LuEURbrOXc9ZF4gLI7F/SYYQW0o78LP7XLImsoGftNTTyU0dC774xBLLC BDrOkVzyd0vHDmHoLv46OaBxE30K3cOJnhkol/6DRcfHyRmeSVXWBkiGfZLcilHs2BlqA/0kRKPR1 ZRS8d3LHzh0/NJRLSK8Owz3LfMrxyincMlD1H3am0iLtwtQ7SxY+HW/u2I09ZI1szs0eqJ516mB2e 7PBXCT6inJayGyV9fiVaJKXKuxw5vLoUaffIO8N8ejLQcrjkunqTvLR4NF5+sLDIe+OZLT5uu00TE JmJPQUbA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pb6Bz-001EKG-Ul; Sat, 11 Mar 2023 20:51:51 +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 v2 4/5] sunrpc: move sunrpc_table and proc routines above Date: Sat, 11 Mar 2023 12:51:47 -0800 Message-Id: <20230311205148.293375-5-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230311205148.293375-1-mcgrof@kernel.org> References: <20230311205148.293375-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 | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c index 3aad6ef18504..a54438d68d1b 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) { @@ -141,7 +122,9 @@ proc_dodebug(struct ctl_table *table, int write, void *buffer, size_t *lenp, *ppos += *lenp; return 0; } +#endif +static struct ctl_table_header *sunrpc_table_header; static struct ctl_table debug_table[] = { { @@ -190,4 +173,19 @@ static struct ctl_table sunrpc_table[] = { { } }; -#endif + +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; + } +}