Skip to content

Commit c946cb6

Browse files
mcgrofamschuma-ntap
authored andcommitted
sunrpc: simplify one-level sysctl registration for xs_tunables_table
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>
1 parent 17c6d0c commit c946cb6

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

net/sunrpc/xprtsock.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static unsigned int xs_tcp_fin_timeout __read_mostly = XS_TCP_LINGER_TO;
7878

7979
/*
8080
* We can register our own files under /proc/sys/sunrpc by
81-
* calling register_sysctl_table() again. The files in that
81+
* calling register_sysctl() again. The files in that
8282
* directory become the union of all files registered there.
8383
*
8484
* We simply need to make sure that we don't collide with
@@ -158,15 +158,6 @@ static struct ctl_table xs_tunables_table[] = {
158158
{ },
159159
};
160160

161-
static struct ctl_table sunrpc_table[] = {
162-
{
163-
.procname = "sunrpc",
164-
.mode = 0555,
165-
.child = xs_tunables_table
166-
},
167-
{ },
168-
};
169-
170161
/*
171162
* Wait duration for a reply from the RPC portmapper.
172163
*/
@@ -3178,7 +3169,7 @@ static struct xprt_class xs_bc_tcp_transport = {
31783169
int init_socket_xprt(void)
31793170
{
31803171
if (!sunrpc_table_header)
3181-
sunrpc_table_header = register_sysctl_table(sunrpc_table);
3172+
sunrpc_table_header = register_sysctl("sunrpc", xs_tunables_table);
31823173

31833174
xprt_register_transport(&xs_local_transport);
31843175
xprt_register_transport(&xs_udp_transport);

0 commit comments

Comments
 (0)