sunrpc: simplify one-level sysctl registration for xs_tunables_table
authorLuis Chamberlain <mcgrof@kernel.org>
Sat, 11 Mar 2023 23:39:42 +0000 (15:39 -0800)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Tue, 11 Apr 2023 16:45:19 +0000 (12:45 -0400)
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 <mcgrof@kernel.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/xprtsock.c

index 6cacd70a15ffa15ed7f70d073cd9d23410d41784..5f9030b81c9eab73419742436fd86f29743a0dbe 100644 (file)
@@ -78,7 +78,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
@@ -158,15 +158,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.
  */
@@ -3178,7 +3169,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);