[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tencent_AE6183E8272FD2DD98F5FCC69E05AA54A809@qq.com>
Date: Sat, 9 Mar 2024 18:31:22 +0800
From: wenyang.linux@...mail.com
To: "Eric W . Biederman" <ebiederm@...ssion.com>,
Luis Chamberlain <mcgrof@...nel.org>,
Kees Cook <keescook@...omium.org>,
Joel Granados <j.granados@...sung.com>,
Christian Brauner <brauner@...nel.org>
Cc: Wen Yang <wenyang.linux@...mail.com>,
"David S. Miller" <davem@...emloft.net>,
David Ahern <dsahern@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 5/9] svcrdma: delete these unnecessary static variables min_ord, max_ord, etc
From: Wen Yang <wenyang.linux@...mail.com>
Delete unnecessary static variables (min_ord, max_ord, etc.)
and encode them directly in the table entry.
Signed-off-by: Wen Yang <wenyang.linux@...mail.com>
Cc: Eric W. Biederman <ebiederm@...ssion.com>
Cc: Luis Chamberlain <mcgrof@...nel.org>
Cc: Kees Cook <keescook@...omium.org>
Cc: Joel Granados <j.granados@...sung.com>
Cc: Christian Brauner <brauner@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: David Ahern <dsahern@...nel.org>
Cc: Eric Dumazet <edumazet@...gle.com>
Cc: Jakub Kicinski <kuba@...nel.org>
Cc: Paolo Abeni <pabeni@...hat.com>
Cc: linux-kernel@...r.kernel.org
---
net/sunrpc/xprtrdma/svc_rdma.c | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c
index f86970733eb0..98cde9c2bf5a 100644
--- a/net/sunrpc/xprtrdma/svc_rdma.c
+++ b/net/sunrpc/xprtrdma/svc_rdma.c
@@ -53,15 +53,9 @@
/* RPC/RDMA parameters */
unsigned int svcrdma_ord = 16; /* historical default */
-static unsigned int min_ord = 1;
-static unsigned int max_ord = 255;
unsigned int svcrdma_max_requests = RPCRDMA_MAX_REQUESTS;
unsigned int svcrdma_max_bc_requests = RPCRDMA_MAX_BC_REQUESTS;
-static unsigned int min_max_requests = 4;
-static unsigned int max_max_requests = 16384;
unsigned int svcrdma_max_req_size = RPCRDMA_DEF_INLINE_THRESH;
-static unsigned int min_max_inline = RPCRDMA_DEF_INLINE_THRESH;
-static unsigned int max_max_inline = RPCRDMA_MAX_INLINE_THRESH;
static unsigned int svcrdma_stat_unused;
static unsigned int zero;
@@ -114,8 +108,9 @@ static struct ctl_table svcrdma_parm_table[] = {
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = &min_max_requests,
- .extra2 = &max_max_requests
+ .min = SYSCTL_NUMERIC_FOUR,
+ .max = SYSCTL_NUMERIC_16K,
+ .extra_flags = SYSCTL_TABLE_EXTRA_LONG_INIT_MINMAX,
},
{
.procname = "max_req_size",
@@ -123,8 +118,9 @@ static struct ctl_table svcrdma_parm_table[] = {
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = &min_max_inline,
- .extra2 = &max_max_inline
+ .min = RPCRDMA_DEF_INLINE_THRESH,
+ .max = RPCRDMA_MAX_INLINE_THRESH,
+ .extra_flags = SYSCTL_TABLE_EXTRA_LONG_INIT_MINMAX,
},
{
.procname = "max_outbound_read_requests",
@@ -132,8 +128,9 @@ static struct ctl_table svcrdma_parm_table[] = {
.maxlen = sizeof(unsigned int),
.mode = 0644,
.proc_handler = proc_dointvec_minmax,
- .extra1 = &min_ord,
- .extra2 = &max_ord,
+ .min = SYSCTL_NUMERIC_ONE,
+ .max = SYSCTL_NUMERIC_U8_MAX,
+ .extra_flags = SYSCTL_TABLE_EXTRA_LONG_INIT_MINMAX,
},
{
--
2.25.1
Powered by blists - more mailing lists