Skip to content

Commit 376bcd9

Browse files
mcgrofchucklever
authored andcommitted
sunrpc: simplify two-level sysctl registration for svcrdma_parm_table
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 <mcgrof@kernel.org> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
1 parent cf64b9b commit 376bcd9

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

net/sunrpc/xprtrdma/svc_rdma.c

+2-19
Original file line numberDiff line numberDiff line change
@@ -212,24 +212,6 @@ static struct ctl_table svcrdma_parm_table[] = {
212212
{ },
213213
};
214214

215-
static struct ctl_table svcrdma_table[] = {
216-
{
217-
.procname = "svc_rdma",
218-
.mode = 0555,
219-
.child = svcrdma_parm_table
220-
},
221-
{ },
222-
};
223-
224-
static struct ctl_table svcrdma_root_table[] = {
225-
{
226-
.procname = "sunrpc",
227-
.mode = 0555,
228-
.child = svcrdma_table
229-
},
230-
{ },
231-
};
232-
233215
static void svc_rdma_proc_cleanup(void)
234216
{
235217
if (!svcrdma_table_header)
@@ -263,7 +245,8 @@ static int svc_rdma_proc_init(void)
263245
if (rc)
264246
goto out_err;
265247

266-
svcrdma_table_header = register_sysctl_table(svcrdma_root_table);
248+
svcrdma_table_header = register_sysctl("sunrpc/svc_rdma",
249+
svcrdma_parm_table);
267250
return 0;
268251

269252
out_err:

0 commit comments

Comments
 (0)