X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lnet%2Flnet%2Facceptor.c;h=5b143a931c45f4c48955c8d83796f0bf43ca6787;hp=c852f16193128aab9424b3b485db6f84633b7131;hb=2c56a64e065f471057928f16b9b550ca0050bdc1;hpb=b74555726d0e8ba1f11ebe959029c59ce9cdc842 diff --git a/lnet/lnet/acceptor.c b/lnet/lnet/acceptor.c index c852f16..5b143a9 100644 --- a/lnet/lnet/acceptor.c +++ b/lnet/lnet/acceptor.c @@ -87,6 +87,18 @@ CFS_MODULE_PARM(accept_backlog, "i", int, 0444, CFS_MODULE_PARM(accept_timeout, "i", int, 0644, "Acceptor's timeout (seconds)"); +static char *accept_type = NULL; + +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) { @@ -221,7 +233,7 @@ EXPORT_SYMBOL(lnet_connect); #else /* below is multi-threaded user-space code */ -static char *accept_type = "secure"; +static char *accept_type = "secure"; int lnet_acceptor_get_tunables() @@ -418,11 +430,7 @@ lnet_acceptor(void *arg) lnet_acceptor_state.pta_sock = NULL; } else { -#ifdef __KERNEL__ - LCONSOLE(0, "Accept %s, port %d\n", accept, accept_port); -#else LCONSOLE(0, "Accept %s, port %d\n", accept_type, accept_port); -#endif } /* set init status and unblock parent */ @@ -517,23 +525,18 @@ lnet_acceptor_start(void) LASSERT (lnet_acceptor_state.pta_sock == NULL); -#ifndef __KERNEL__ - /* kernel version uses CFS_MODULE_PARM */ rc = lnet_acceptor_get_tunables(); if (rc != 0) return rc; +#ifndef __KERNEL__ /* Do nothing if we're liblustre clients */ if ((the_lnet.ln_pid & LNET_PID_USERFLAG) != 0) return 0; #endif cfs_init_completion(&lnet_acceptor_state.pta_signal); -#ifdef __KERNEL__ - rc = accept2secure(accept, &secure); -#else rc = accept2secure(accept_type, &secure); -#endif if (rc <= 0) { cfs_fini_completion(&lnet_acceptor_state.pta_signal); return rc;