Whamcloud - gitweb
LU-10391 lnet: remove 'accept' variable. 94/37694/4
authorMr NeilBrown <neilb@suse.de>
Fri, 7 Feb 2020 02:05:57 +0000 (13:05 +1100)
committerOleg Drokin <green@whamcloud.com>
Wed, 11 Mar 2020 02:10:12 +0000 (02:10 +0000)
lnet/acceptor.c has two variables, "accept" and "accept_type",
which have identical content and purpose.
Remove "accept" and just use "accept_type".

As the module parameter "accept" will now represent the value stored
in the variable "accept_type", we need to use module_param_named() to
allow the module parameter to have a different name to the kernel
variable.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I938418c971dfdd9f6e5c8c22c03e992432082334
Reviewed-on: https://review.whamcloud.com/37694
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/lnet/acceptor.c

index 5de4d44..75e9f27 100644 (file)
@@ -71,9 +71,9 @@ lnet_accept_magic(__u32 magic, __u32 constant)
 
 EXPORT_SYMBOL(lnet_acceptor_port);
 
-static char *accept = "secure";
+static char *accept_type = "secure";
 
-module_param(accept, charp, 0444);
+module_param_named(accept, accept_type, charp, 0444);
 MODULE_PARM_DESC(accept, "Accept connections (secure|all|none)");
 module_param(accept_port, int, 0444);
 MODULE_PARM_DESC(accept_port, "Acceptor's port (same on all nodes)");
@@ -82,18 +82,6 @@ MODULE_PARM_DESC(accept_backlog, "Acceptor's listen backlog");
 module_param(accept_timeout, int, 0644);
 MODULE_PARM_DESC(accept_timeout, "Acceptor's timeout (seconds)");
 
-static char *accept_type = NULL;
-
-static int
-lnet_acceptor_get_tunables(void)
-{
-       /* Userland acceptor uses 'accept_type' instead of 'accept', due to
-        * conflict with 'accept(2)', but kernel acceptor still uses 'accept'
-        * for compatibility. Hence the trick. */
-       accept_type = accept;
-       return 0;
-}
-
 int
 lnet_acceptor_timeout(void)
 {
@@ -500,10 +488,6 @@ lnet_acceptor_start(void)
 
        LASSERT(lnet_acceptor_state.pta_sock == NULL);
 
-       rc = lnet_acceptor_get_tunables();
-       if (rc != 0)
-               return rc;
-
        init_completion(&lnet_acceptor_state.pta_signal);
        rc = accept2secure(accept_type, &secure);
        if (rc <= 0)