* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2012, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
static int accept_backlog = 127;
static int accept_timeout = 5;
-struct {
+static struct {
int pta_shutdown;
cfs_socket_t *pta_sock;
struct completion pta_signal;
-} lnet_acceptor_state;
+} lnet_acceptor_state = {
+ .pta_shutdown = 1
+};
int
lnet_acceptor_port(void)
static char *accept_type = NULL;
-int
+static int
lnet_acceptor_get_tunables(void)
{
/* Userland acceptor uses 'accept_type' instead of 'accept', due to
/* Below is the code common for both kernel and MT user-space */
-int
+static int
lnet_accept(cfs_socket_t *sock, __u32 magic)
{
lnet_acceptor_connreq_t cr;
return rc;
}
-int
+static int
lnet_acceptor(void *arg)
{
cfs_socket_t *newsock;
long rc2;
long secure;
+ /* if acceptor is already running return immediately */
+ if (!lnet_acceptor_state.pta_shutdown)
+ return 0;
+
LASSERT (lnet_acceptor_state.pta_sock == NULL);
rc = lnet_acceptor_get_tunables();
void
lnet_acceptor_stop(void)
{
- if (lnet_acceptor_state.pta_sock == NULL) /* not running */
+ if (lnet_acceptor_state.pta_shutdown) /* not running */
return;
lnet_acceptor_state.pta_shutdown = 1;