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>
EXPORT_SYMBOL(lnet_acceptor_port);
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)");
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)");
module_param(accept_timeout, int, 0644);
MODULE_PARM_DESC(accept_timeout, "Acceptor's timeout (seconds)");
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)
{
int
lnet_acceptor_timeout(void)
{
LASSERT(lnet_acceptor_state.pta_sock == NULL);
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)
init_completion(&lnet_acceptor_state.pta_signal);
rc = accept2secure(accept_type, &secure);
if (rc <= 0)