Commit 03bb015c authored by Ben Walker's avatar Ben Walker
Browse files

nbd: Remove extra event on shutdown



nbd_start(), nbd_poll(), and nbd_stop() will all be called
on the same core, so the poller unregister will complete
synchronously.

Change-Id: I4f83f3821102277704422ed63d4cde424324e0a4
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/387686


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent 4927c206
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -49,20 +49,13 @@ static char *g_nbd_name = "/dev/nbd0";

#include "../common.c"

static void
nbd_stop(void *arg1, void *arg2)
{
	spdk_nbd_stop(g_nbd_disk);
	spdk_app_stop(0);
}

static void
nbd_shutdown(void)
{
	struct spdk_event *stop_event;
	spdk_poller_unregister(&g_nbd_poller, NULL);

	stop_event = spdk_event_allocate(spdk_env_get_current_core(), nbd_stop, NULL, NULL);
	spdk_poller_unregister(&g_nbd_poller, stop_event);
	spdk_nbd_stop(g_nbd_disk);
	spdk_app_stop(0);
}

static void