lib/rocksdb Use spdk_bdev_create_bs_dev_ext() to pass bdev_name
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I4acce43baa95d0968b7b568e87fade1972efc646 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4704 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
parent
6a72c19ee2
commit
9b32f4858c
@ -662,22 +662,28 @@ fs_load_cb(__attribute__((unused)) void *ctx,
|
||||
g_spdk_ready = true;
|
||||
}
|
||||
|
||||
static void
|
||||
base_bdev_event_cb(enum spdk_bdev_event_type type, struct spdk_bdev *bdev,
|
||||
void *event_ctx)
|
||||
{
|
||||
printf("Unsupported bdev event: type %d\n", type);
|
||||
}
|
||||
|
||||
static void
|
||||
rocksdb_run(__attribute__((unused)) void *arg1)
|
||||
{
|
||||
struct spdk_bdev *bdev;
|
||||
int rc;
|
||||
|
||||
bdev = spdk_bdev_get_by_name(g_bdev_name.c_str());
|
||||
|
||||
if (bdev == NULL) {
|
||||
SPDK_ERRLOG("bdev %s not found\n", g_bdev_name.c_str());
|
||||
rc = spdk_bdev_create_bs_dev_ext(g_bdev_name.c_str(), base_bdev_event_cb, NULL,
|
||||
&g_bs_dev);
|
||||
if (rc != 0) {
|
||||
printf("Could not create blob bdev\n");
|
||||
spdk_app_stop(0);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
g_lcore = spdk_env_get_first_core();
|
||||
|
||||
g_bs_dev = spdk_bdev_create_bs_dev(bdev, NULL, NULL);
|
||||
printf("using bdev %s\n", g_bdev_name.c_str());
|
||||
spdk_fs_load(g_bs_dev, __send_request, fs_load_cb, NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user