nvmf: Use threads instead of events for shutdown handling

Change-Id: Ib22dcb95810f4ed16beb76769e407d48713d85ad
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447117
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Ben Walker 2019-03-05 14:35:43 -07:00 committed by Changpeng Liu
parent 9603e344ae
commit a0760b9554

View File

@ -85,12 +85,11 @@ static struct spdk_poller *g_acceptor_poller = NULL;
static void nvmf_tgt_advance_state(void);
static void
_spdk_nvmf_shutdown_cb(void *arg1, void *arg2)
_spdk_nvmf_shutdown_cb(void *arg1)
{
/* Still in initialization state, defer shutdown operation */
if (g_tgt_state < NVMF_TGT_RUNNING) {
spdk_event_call(spdk_event_allocate(spdk_env_get_current_core(),
_spdk_nvmf_shutdown_cb, NULL, NULL));
spdk_thread_send_msg(spdk_get_thread(), _spdk_nvmf_shutdown_cb, NULL);
return;
} else if (g_tgt_state > NVMF_TGT_RUNNING) {
/* Already in Shutdown status, ignore the signal */
@ -104,7 +103,7 @@ _spdk_nvmf_shutdown_cb(void *arg1, void *arg2)
static void
spdk_nvmf_subsystem_fini(void)
{
_spdk_nvmf_shutdown_cb(NULL, NULL);
_spdk_nvmf_shutdown_cb(NULL);
}
static void