2024-03-19 16:03:40

by Wen Yang

[permalink] [raw]
Subject: [RESEND PATCH v2 5/9] svcrdma: delete these unnecessary static variables min_ord, max_ord, etc

From: Wen Yang <[email protected]>

Delete unnecessary static variables (min_ord, max_ord, etc.)
and encode them directly in the table entry.

Signed-off-by: Wen Yang <[email protected]>
Cc: Eric W. Biederman <[email protected]>
Cc: Luis Chamberlain <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: Joel Granados <[email protected]>
Cc: Christian Brauner <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: [email protected]
---
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