From: Mr NeilBrown Date: Fri, 7 Feb 2020 02:05:57 +0000 (+1100) Subject: LU-10391 lnet: remove 'accept' variable. X-Git-Tag: 2.13.53~107 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=24ab342d6e7b22628b096d89cdfe1d0d54d5551a;p=fs%2Flustre-release.git LU-10391 lnet: remove 'accept' variable. 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 Change-Id: I938418c971dfdd9f6e5c8c22c03e992432082334 Reviewed-on: https://review.whamcloud.com/37694 Reviewed-by: Andreas Dilger Reviewed-by: Chris Horn Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lnet/lnet/acceptor.c b/lnet/lnet/acceptor.c index 5de4d44..75e9f27 100644 --- a/lnet/lnet/acceptor.c +++ b/lnet/lnet/acceptor.c @@ -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)