fio: Close bdevs inside of a thread message

This ensures that it runs on an SPDK thread.

Change-Id: If57161ebafe97d592fe6ffec1a7aa135beebdc7a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/436553
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
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>
This commit is contained in:
Ben Walker 2018-12-07 13:57:52 -07:00
parent b9cdb813fe
commit 443c6e401b

View File

@ -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) {}