Commit 443c6e40 authored by Ben Walker's avatar Ben Walker
Browse files

fio: Close bdevs inside of a thread message



This ensures that it runs on an SPDK thread.

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


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent b9cdb813
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -121,8 +121,9 @@ spdk_fio_init_thread(struct thread_data *td)
}

static void
spdk_fio_cleanup_thread(struct spdk_fio_thread *fio_thread)
spdk_fio_bdev_close_targets(void *arg)
{
	struct spdk_fio_thread *fio_thread = arg;
	struct spdk_fio_target *target, *tmp;

	TAILQ_FOREACH_SAFE(target, &fio_thread->targets, link, tmp) {
@@ -131,6 +132,12 @@ spdk_fio_cleanup_thread(struct spdk_fio_thread *fio_thread)
		spdk_bdev_close(target->desc);
		free(target);
	}
}

static void
spdk_fio_cleanup_thread(struct spdk_fio_thread *fio_thread)
{
	spdk_thread_send_msg(fio_thread->thread, spdk_fio_bdev_close_targets, fio_thread);

	while (spdk_fio_poll_thread(fio_thread) > 0) {}