From patchwork Fri Mar 10 22:52:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13170366 X-Patchwork-Delegate: kuba@kernel.org 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 D4013C7618B for ; Fri, 10 Mar 2023 22:53:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231878AbjCJWxC (ORCPT ); Fri, 10 Mar 2023 17:53:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231784AbjCJWww (ORCPT ); Fri, 10 Mar 2023 17:52:52 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 875E510D320; Fri, 10 Mar 2023 14:52:51 -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=XIoPX8KdCwgXnvpcDRNW0+6992U8KOWdKG/zQLzC1bo=; b=SsN48bT2cXvGjE0yyPI8ZTaGV9 Iq5HukBW7bOWhpe7XU9/Bm7DfvT6eGT3qOF1N9p5AFoVks2fzjW2MJlqecVVt1Jiamjxz+KW/CXD5 v1WLalm7vTLn7wnlrMd+zwJAlVRB0d9cEy13dkNsA55pZ8Tfanssuuzxk/bEARVrADse07AirAKwX qBSyPUPQo4Dss2dgonTJ9n3XMemigXQ6qPpjddfyI07UaynXBAtSp9QDm2bc0TgvEjcrWYBIAMbZ/ XQyto/igbwnSCE63KS8nC+9Tz/vdrLGQmGDFxzPlMTPp11lIRqiuviYnswua2QrFadfbHCmiV4M6u 8wuChM3g==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1palbL-00GWqe-Ju; Fri, 10 Mar 2023 22:52:39 +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 1/5] sunrpc: simplify two-level sysctl registration for tsvcrdma_parm_table Date: Fri, 10 Mar 2023 14:52:32 -0800 Message-Id: <20230310225236.3939443-2-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230310225236.3939443-1-mcgrof@kernel.org> References: <20230310225236.3939443-1-mcgrof@kernel.org> MIME-Version: 1.0 Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org There is no need to declare two tables to just create directories, this can be easily be done with a prefix path with register_sysctl(). Simplify this registration. Signed-off-by: Luis Chamberlain --- net/sunrpc/xprtrdma/svc_rdma.c | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c index 5bc20e9d09cd..f0d5eeed4c88 100644 --- a/net/sunrpc/xprtrdma/svc_rdma.c +++ b/net/sunrpc/xprtrdma/svc_rdma.c @@ -212,24 +212,6 @@ static struct ctl_table svcrdma_parm_table[] = { { }, }; -static struct ctl_table svcrdma_table[] = { - { - .procname = "svc_rdma", - .mode = 0555, - .child = svcrdma_parm_table - }, - { }, -}; - -static struct ctl_table svcrdma_root_table[] = { - { - .procname = "sunrpc", - .mode = 0555, - .child = svcrdma_table - }, - { }, -}; - static void svc_rdma_proc_cleanup(void) { if (!svcrdma_table_header) @@ -263,7 +245,8 @@ static int svc_rdma_proc_init(void) if (rc) goto out_err; - svcrdma_table_header = register_sysctl_table(svcrdma_root_table); + svcrdma_table_header = register_sysctl("sunrpc/svc_rdma", + svcrdma_parm_table); return 0; out_err: From patchwork Fri Mar 10 22:52:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13170365 X-Patchwork-Delegate: kuba@kernel.org 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 BBBD4C74A4B for ; Fri, 10 Mar 2023 22:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231779AbjCJWw7 (ORCPT ); Fri, 10 Mar 2023 17:52:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231775AbjCJWww (ORCPT ); Fri, 10 Mar 2023 17:52:52 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7215110D31D; Fri, 10 Mar 2023 14:52:51 -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=NH4tVoLA/Ab9gFvMSSGVxXB8I+Y2VZfuJjnFdVe1WZI=; b=g2WG9m4qCNfwuyXr+5rMrfo1Nj eiO2Oij9/PWncVESU+Bx3H62n4APAbK9BZXD9f+azzQQpOgRtb39KQBTd5YDBaZJyIHfuOP1CFSUN +kg5fNOV0wa5gxB20zdISyswRxshVEUdTaHYctmY5D8Y5g91S5eD+Q7maV+xD+HYN/dlDGFantS+C q+Je++Y7NyOq7G6tzv9CmIduT92ebVwguGPOu0q0Uga2Klhqo6aAU8yyI9nR/6OBEnTTlUqQd3Ni/ 1n/XvhNTwTDs8yXe0454wnVC8JmnXTBru09ohUUDp/g5ha1Zr2viON2DePX9lRe26Y8DZWfdXVkcZ VRHl66TA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1palbL-00GWqh-La; Fri, 10 Mar 2023 22:52:39 +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 2/5] sunrpc: simplify one-level sysctl registration for xr_tunables_table Date: Fri, 10 Mar 2023 14:52:33 -0800 Message-Id: <20230310225236.3939443-3-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230310225236.3939443-1-mcgrof@kernel.org> References: <20230310225236.3939443-1-mcgrof@kernel.org> MIME-Version: 1.0 Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org There is no need to declare an extra tables to just create directory, this can be easily be done with a prefix path with register_sysctl(). Simplify this registration. Signed-off-by: Luis Chamberlain --- net/sunrpc/xprtrdma/transport.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c index 10bb2b929c6d..29b0562d62e7 100644 --- a/net/sunrpc/xprtrdma/transport.c +++ b/net/sunrpc/xprtrdma/transport.c @@ -140,15 +140,6 @@ static struct ctl_table xr_tunables_table[] = { { }, }; -static struct ctl_table sunrpc_table[] = { - { - .procname = "sunrpc", - .mode = 0555, - .child = xr_tunables_table - }, - { }, -}; - #endif static const struct rpc_xprt_ops xprt_rdma_procs; @@ -799,7 +790,7 @@ int xprt_rdma_init(void) #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) if (!sunrpc_table_header) - sunrpc_table_header = register_sysctl_table(sunrpc_table); + sunrpc_table_header = register_sysctl("sunrpc", xr_tunables_table); #endif return 0; } From patchwork Fri Mar 10 22:52:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13170362 X-Patchwork-Delegate: kuba@kernel.org 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 D6B71C6FD19 for ; Fri, 10 Mar 2023 22:52:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231764AbjCJWww (ORCPT ); Fri, 10 Mar 2023 17:52:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230207AbjCJWwt (ORCPT ); Fri, 10 Mar 2023 17:52:49 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04A7110CEB6; Fri, 10 Mar 2023 14:52:49 -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=JMrOLqBblBfuXk+q4S5+9mk7xuUL4OAY5iCRONC3a9s=; b=ORXBjQLdXg5ueh0ftFlBOiakYq sIBCVRcvIsD9oCpjIfZULUv1PPM61KzLHOWlYCssy0yiQxhKBLzO1IzutXl6YtniOB+dXD8ecX8Ol bKna/AnveqTslVzmvOeFVE0qZce4UPeBlC4yy7TbJ7AKPFBOuvHWHzU1E14znz5DhfpDLu3RYpxAX qw6kC5273MAGBIeHtx93Q5BQdhasc7IwQWK8S+cQg0b8PnVwJzlY+eM4zDoULpuYvrDuCn/kDDvHh p2VTGvH0HCQy3Ue/IPSGM62LXYJfeT2m+anmO55FzoG+Jz0VF6ARF1OmGUSG8oennNf/LQ4CU8TAE TFb7OC9w==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1palbL-00GWqj-NU; Fri, 10 Mar 2023 22:52:39 +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 3/5] sunrpc: simplify one-level sysctl registration for xs_tunables_table Date: Fri, 10 Mar 2023 14:52:34 -0800 Message-Id: <20230310225236.3939443-4-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230310225236.3939443-1-mcgrof@kernel.org> References: <20230310225236.3939443-1-mcgrof@kernel.org> MIME-Version: 1.0 Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org There is no need to declare an extra tables to just create directory, this can be easily be done with a prefix path with register_sysctl(). Simplify this registration. Signed-off-by: Luis Chamberlain --- net/sunrpc/xprtsock.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index aaa5b2741b79..46bbd6230650 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -77,7 +77,7 @@ static unsigned int xs_tcp_fin_timeout __read_mostly = XS_TCP_LINGER_TO; /* * We can register our own files under /proc/sys/sunrpc by - * calling register_sysctl_table() again. The files in that + * calling register_sysctl() again. The files in that * directory become the union of all files registered there. * * We simply need to make sure that we don't collide with @@ -157,15 +157,6 @@ static struct ctl_table xs_tunables_table[] = { { }, }; -static struct ctl_table sunrpc_table[] = { - { - .procname = "sunrpc", - .mode = 0555, - .child = xs_tunables_table - }, - { }, -}; - /* * Wait duration for a reply from the RPC portmapper. */ @@ -3174,7 +3165,7 @@ static struct xprt_class xs_bc_tcp_transport = { int init_socket_xprt(void) { if (!sunrpc_table_header) - sunrpc_table_header = register_sysctl_table(sunrpc_table); + sunrpc_table_header = register_sysctl("sunrpc", xs_tunables_table); xprt_register_transport(&xs_local_transport); xprt_register_transport(&xs_udp_transport); From patchwork Fri Mar 10 22:52:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13170364 X-Patchwork-Delegate: kuba@kernel.org 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 A676AC6FA99 for ; Fri, 10 Mar 2023 22:53:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231898AbjCJWw5 (ORCPT ); Fri, 10 Mar 2023 17:52:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231628AbjCJWww (ORCPT ); Fri, 10 Mar 2023 17:52:52 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1004110CEBC; Fri, 10 Mar 2023 14:52:51 -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=5AEXZhFwc3nu6gDvyJ80uX9izlYPfp1V+xq1fr6lUzs=; b=hWaTCXnCUeMj6+QQsXm4vY3590 pPIGHfDj7JjkgYhreQWe+A97o8Lxlb924FtWqY3GWxFTay3W3zsgv8VzLQ5EWW7JQ8U8Q5UoEytcg 4eHsN2qzWirjN2PAVNiPRozkJpSIT/7gwmGvK4zuRmtB7GGGRA6VljrRR/xGyvzJ3TE8T4dU/lNQ6 TIry1vKyTBckVt914lwMeGG8VatiP99arUOGx4DPcOkvF5qvOJezYaPRWV2JRH40QIt5QVXM7CNX0 E42124ao1F3oOoRxaeHM5/diX610n0Lb5nnfWVS0pcDBl81IUlItRpnXFtNeCmUJGz0eD1jYLtYTi QDR8kPHg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1palbL-00GWql-Pa; Fri, 10 Mar 2023 22:52:39 +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 4/5] sunrpc: move sunrpc_table above Date: Fri, 10 Mar 2023 14:52:35 -0800 Message-Id: <20230310225236.3939443-5-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230310225236.3939443-1-mcgrof@kernel.org> References: <20230310225236.3939443-1-mcgrof@kernel.org> MIME-Version: 1.0 Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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 | 98 ++++++++++++++++++++++----------------------- 1 file changed, 48 insertions(+), 50 deletions(-) diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c index 3aad6ef18504..4120797bf740 100644 --- a/net/sunrpc/sysctl.c +++ b/net/sunrpc/sysctl.c @@ -41,7 +41,54 @@ 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[]; + +static struct ctl_table debug_table[] = { + { + .procname = "rpc_debug", + .data = &rpc_debug, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dodebug + }, + { + .procname = "nfs_debug", + .data = &nfs_debug, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dodebug + }, + { + .procname = "nfsd_debug", + .data = &nfsd_debug, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dodebug + }, + { + .procname = "nlm_debug", + .data = &nlm_debug, + .maxlen = sizeof(int), + .mode = 0644, + .proc_handler = proc_dodebug + }, + { + .procname = "transports", + .maxlen = 256, + .mode = 0444, + .proc_handler = proc_do_xprt, + }, + { } +}; + +static struct ctl_table sunrpc_table[] = { + { + .procname = "sunrpc", + .mode = 0555, + .child = debug_table + }, + { } +}; + void rpc_register_sysctl(void) @@ -141,53 +188,4 @@ proc_dodebug(struct ctl_table *table, int write, void *buffer, size_t *lenp, *ppos += *lenp; return 0; } - - -static struct ctl_table debug_table[] = { - { - .procname = "rpc_debug", - .data = &rpc_debug, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dodebug - }, - { - .procname = "nfs_debug", - .data = &nfs_debug, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dodebug - }, - { - .procname = "nfsd_debug", - .data = &nfsd_debug, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dodebug - }, - { - .procname = "nlm_debug", - .data = &nlm_debug, - .maxlen = sizeof(int), - .mode = 0644, - .proc_handler = proc_dodebug - }, - { - .procname = "transports", - .maxlen = 256, - .mode = 0444, - .proc_handler = proc_do_xprt, - }, - { } -}; - -static struct ctl_table sunrpc_table[] = { - { - .procname = "sunrpc", - .mode = 0555, - .child = debug_table - }, - { } -}; - #endif From patchwork Fri Mar 10 22:52:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Chamberlain X-Patchwork-Id: 13170363 X-Patchwork-Delegate: kuba@kernel.org 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 11D95C6FD1E for ; Fri, 10 Mar 2023 22:52:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231830AbjCJWwz (ORCPT ); Fri, 10 Mar 2023 17:52:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231759AbjCJWwv (ORCPT ); Fri, 10 Mar 2023 17:52:51 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D26EE10CEB6; Fri, 10 Mar 2023 14:52:50 -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=QW9GIbAobkeAXWbUYe5gq2AaLt/O0c18zzLfU/gY9Eg=; b=zGkV+OLlEKWU+12XWv2DkVkSEu b3wSv+r4o8A9DyZ79zE9r+xoj5nbYWztfKpbo+APy07H1OVlcgy0S8Xu3+ANsFRXLVxQFV1Ui+wMh 7y+O4+fPY0EZZO0G9jj/koXh/wJ73RqLQpd9G2VpPnNfJFgGEMBhb8JYbLd56op2YEEYN+OZPwjzt WEk0KZ3Sx2HpwCR+SOcLXjibh0LYRMeb/mearHB1w8lnn50wiMP4CA1x8HVytqC59RN7eTHht4zf9 ar8m14K6i9OnW9jXlfMlYA63nt3Cr2TKggHHjMTaeMWMRSlX8SAnZxj4/JRM9aLDF9LXLs7SyBPar Pq0G6vaw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1palbL-00GWqp-RQ; Fri, 10 Mar 2023 22:52:39 +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 5/5] sunrpc: simplify one-level sysctl registration for debug_table Date: Fri, 10 Mar 2023 14:52:36 -0800 Message-Id: <20230310225236.3939443-6-mcgrof@kernel.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230310225236.3939443-1-mcgrof@kernel.org> References: <20230310225236.3939443-1-mcgrof@kernel.org> MIME-Version: 1.0 Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org There is no need to declare an extra tables to just create directory, this can be easily be done with a prefix path with register_sysctl(). Simplify this registration. Signed-off-by: Luis Chamberlain --- net/sunrpc/sysctl.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c index 4120797bf740..8000828b139f 100644 --- a/net/sunrpc/sysctl.c +++ b/net/sunrpc/sysctl.c @@ -80,21 +80,11 @@ static struct ctl_table debug_table[] = { { } }; -static struct ctl_table sunrpc_table[] = { - { - .procname = "sunrpc", - .mode = 0555, - .child = debug_table - }, - { } -}; - - void rpc_register_sysctl(void) { if (!sunrpc_table_header) - sunrpc_table_header = register_sysctl_table(sunrpc_table); + sunrpc_table_header = register_sysctl("sunrpc", debug_table); } void