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 <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/464177
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Broadcom SPDK FC-NVMe CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Tomasz Zawadzki 2019-08-02 09:33:07 -04:00 committed by Jim Harris
parent 1428692e1a
commit 02aa7d925b
2 changed files with 5 additions and 15 deletions

View File

@ -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

View File

@ -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 *