[RESEND PATCH v2 5/9] svcrdma: delete these unnecessary static variables min_ord, max_ord, etc
From: wenyang . linux
Date: Tue Mar 19 2024 - 12:03:39 EST
From: Wen Yang <wenyang.linux@xxxxxxxxxxx>
Delete unnecessary static variables (min_ord, max_ord, etc.)
and encode them directly in the table entry.
Signed-off-by: Wen Yang <wenyang.linux@xxxxxxxxxxx>
Cc: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>
Cc: Luis Chamberlain <mcgrof@xxxxxxxxxx>
Cc: Kees Cook <keescook@xxxxxxxxxxxx>
Cc: Joel Granados <j.granados@xxxxxxxxxxx>
Cc: Christian Brauner <brauner@xxxxxxxxxx>
Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxxx>
Cc: Eric Dumazet <edumazet@xxxxxxxxxx>
Cc: Jakub Kicinski <kuba@xxxxxxxxxx>
Cc: Paolo Abeni <pabeni@xxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
---
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