Commit 9b32f485 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Tomasz Zawadzki
Browse files

lib/rocksdb Use spdk_bdev_create_bs_dev_ext() to pass bdev_name

parent 6a72c19e
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -663,21 +663,27 @@ fs_load_cb(__attribute__((unused)) void *ctx,
}

static void
rocksdb_run(__attribute__((unused)) void *arg1)
base_bdev_event_cb(enum spdk_bdev_event_type type, struct spdk_bdev *bdev,
		   void *event_ctx)
{
	struct spdk_bdev *bdev;
	printf("Unsupported bdev event: type %d\n", type);
}

	bdev = spdk_bdev_get_by_name(g_bdev_name.c_str());
static void
rocksdb_run(__attribute__((unused)) void *arg1)
{
	int rc;

	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);
}