From 02aa7d925b88533dff313df15435b66337218905 Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Fri, 2 Aug 2019 09:33:07 -0400 Subject: [PATCH] example/fio: call subsystem initialization directly spdk_subsystem_init() no longer depends on spdk_event or app.c part of the event framework. This makes it possible to directly call subsystem initialization, instead of invoking each used library. Change-Id: I53550850d54e2397e2719fdeb559ed50aa81e704 Signed-off-by: Tomasz Zawadzki Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464177 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Broadcom SPDK FC-NVMe CI Reviewed-by: Jim Harris --- examples/bdev/fio_plugin/Makefile | 1 + examples/bdev/fio_plugin/fio_plugin.c | 19 ++++--------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/examples/bdev/fio_plugin/Makefile b/examples/bdev/fio_plugin/Makefile index d93e5e101..a76b01352 100644 --- a/examples/bdev/fio_plugin/Makefile +++ b/examples/bdev/fio_plugin/Makefile @@ -44,5 +44,6 @@ LDFLAGS += -shared -rdynamic -Wl,-z,nodelete SPDK_LIB_LIST = $(ALL_MODULES_LIST) SPDK_LIB_LIST += thread util bdev conf copy rpc jsonrpc json log sock trace notify +SPDK_LIB_LIST += event event_bdev event_copy event_vmd include $(SPDK_ROOT_DIR)/mk/spdk.app.mk diff --git a/examples/bdev/fio_plugin/fio_plugin.c b/examples/bdev/fio_plugin/fio_plugin.c index 0c40380a7..2a237d8aa 100644 --- a/examples/bdev/fio_plugin/fio_plugin.c +++ b/examples/bdev/fio_plugin/fio_plugin.c @@ -44,6 +44,7 @@ #include "spdk/util.h" #include "spdk_internal/thread.h" +#include "spdk_internal/event.h" #include "config-host.h" #include "fio.h" @@ -189,7 +190,7 @@ static pthread_cond_t g_init_cond; static bool g_poll_loop = true; static void -spdk_fio_bdev_init_done(void *cb_arg, int rc) +spdk_fio_bdev_init_done(int rc, void *cb_arg) { *(bool *)cb_arg = true; } @@ -199,11 +200,7 @@ spdk_fio_bdev_init_start(void *arg) { bool *done = arg; - /* Initialize the copy engine */ - spdk_copy_engine_initialize(); - - /* Initialize the bdev layer */ - spdk_bdev_initialize(spdk_fio_bdev_init_done, done); + spdk_subsystem_init(spdk_fio_bdev_init_done, done); } static void @@ -212,20 +209,12 @@ spdk_fio_bdev_fini_done(void *cb_arg) *(bool *)cb_arg = true; } -static void -spdk_fio_copy_fini_start(void *arg) -{ - bool *done = arg; - - spdk_copy_engine_finish(spdk_fio_bdev_fini_done, done); -} - static void spdk_fio_bdev_fini_start(void *arg) { bool *done = arg; - spdk_bdev_finish(spdk_fio_copy_fini_start, done); + spdk_subsystem_fini(spdk_fio_bdev_fini_done, done); } static void *