/* NB called holding the global mutex */
/* All quiet on the API front */
- LASSERT(!the_lnet.ln_shutdown);
+ LASSERT(the_lnet.ln_state == LNET_STATE_RUNNING);
LASSERT(the_lnet.ln_refcount == 0);
lnet_net_lock(LNET_LOCK_EX);
- the_lnet.ln_shutdown = 1; /* flag shutdown */
+ the_lnet.ln_state = LNET_STATE_STOPPING;
while (!list_empty(&the_lnet.ln_nets)) {
/*
}
lnet_net_lock(LNET_LOCK_EX);
- the_lnet.ln_shutdown = 0;
+ the_lnet.ln_state = LNET_STATE_SHUTDOWN;
lnet_net_unlock(LNET_LOCK_EX);
}
int rc;
int ni_count = 0;
+ /*
+ * Change to running state before bringing up the LNDs. This
+ * allows lnet_shutdown_lndnets() to assert that we've passed
+ * through here.
+ */
+ lnet_net_lock(LNET_LOCK_EX);
+ the_lnet.ln_state = LNET_STATE_RUNNING;
+ lnet_net_unlock(LNET_LOCK_EX);
+
while (!list_empty(netlist)) {
net = list_entry(netlist->next, struct lnet_net, net_list);
list_del_init(&net->net_list);