diff --git a/examples/blob/hello_world/hello_blob.c b/examples/blob/hello_world/hello_blob.c index 3876d114cf..32bcbddbb5 100644 --- a/examples/blob/hello_world/hello_blob.c +++ b/examples/blob/hello_world/hello_blob.c @@ -427,7 +427,7 @@ hello_start(void *arg1, void *arg2) * However blobstore can be more tightly integrated into * any lower layer, such as NVMe for example. */ - bs_dev = spdk_bdev_create_bs_dev(bdev); + bs_dev = spdk_bdev_create_bs_dev(bdev, NULL, NULL); if (bs_dev == NULL) { SPDK_ERRLOG("Could not create blob bdev!!\n"); spdk_app_stop(-1); diff --git a/include/spdk/blob_bdev.h b/include/spdk/blob_bdev.h index 674427b20b..883791fa14 100644 --- a/include/spdk/blob_bdev.h +++ b/include/spdk/blob_bdev.h @@ -39,6 +39,7 @@ #define SPDK_BLOB_BDEV_H #include "spdk/stdinc.h" +#include "spdk/bdev.h" #ifdef __cplusplus extern "C" { @@ -47,7 +48,8 @@ extern "C" { struct spdk_bs_dev; struct spdk_bdev; -struct spdk_bs_dev *spdk_bdev_create_bs_dev(struct spdk_bdev *); +struct spdk_bs_dev *spdk_bdev_create_bs_dev(struct spdk_bdev *bdev, spdk_bdev_remove_cb_t remove_cb, + void *remove_ctx); #ifdef __cplusplus } diff --git a/lib/bdev/lvol/vbdev_lvol.c b/lib/bdev/lvol/vbdev_lvol.c index b03e728fbc..4b38a21f98 100644 --- a/lib/bdev/lvol/vbdev_lvol.c +++ b/lib/bdev/lvol/vbdev_lvol.c @@ -91,7 +91,7 @@ vbdev_lvs_create(struct spdk_bdev *base_bdev, return -ENOMEM; } - bs_dev = spdk_bdev_create_bs_dev(base_bdev); + bs_dev = spdk_bdev_create_bs_dev(base_bdev, NULL, NULL); if (!bs_dev) { SPDK_ERRLOG("Cannot create blobstore device\n"); free(lvs_req); diff --git a/lib/blob/bdev/blob_bdev.c b/lib/blob/bdev/blob_bdev.c index 57649a4a88..d09232f2b9 100644 --- a/lib/blob/bdev/blob_bdev.c +++ b/lib/blob/bdev/blob_bdev.c @@ -35,7 +35,6 @@ #include "spdk/blob_bdev.h" #include "spdk/blob.h" -#include "spdk/bdev.h" #include "spdk/io_channel.h" #include "spdk/log.h" #include "spdk/endian.h" @@ -159,7 +158,7 @@ bdev_blob_destroy(struct spdk_bs_dev *bs_dev) } struct spdk_bs_dev * -spdk_bdev_create_bs_dev(struct spdk_bdev *bdev) +spdk_bdev_create_bs_dev(struct spdk_bdev *bdev, spdk_bdev_remove_cb_t remove_cb, void *remove_ctx) { struct blob_bdev *b; struct spdk_bdev_desc *desc; @@ -172,7 +171,7 @@ spdk_bdev_create_bs_dev(struct spdk_bdev *bdev) return NULL; } - rc = spdk_bdev_open(bdev, true, NULL, NULL, &desc); + rc = spdk_bdev_open(bdev, true, remove_cb, remove_ctx, &desc); if (rc != 0) { SPDK_ERRLOG("could not open bdev, error=%d\n", rc); free(b); diff --git a/lib/rocksdb/env_spdk.cc b/lib/rocksdb/env_spdk.cc index 47f602406d..06b16be436 100644 --- a/lib/rocksdb/env_spdk.cc +++ b/lib/rocksdb/env_spdk.cc @@ -550,7 +550,7 @@ spdk_rocksdb_run(void *arg1, void *arg2) g_lcore = spdk_env_get_first_core(); - g_bs_dev = spdk_bdev_create_bs_dev(bdev); + 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); } diff --git a/test/lib/blobfs/fuse/fuse.c b/test/lib/blobfs/fuse/fuse.c index 3a8ff37540..6218764c45 100644 --- a/test/lib/blobfs/fuse/fuse.c +++ b/test/lib/blobfs/fuse/fuse.c @@ -246,7 +246,7 @@ construct_targets(void) exit(1); } - g_bs_dev = spdk_bdev_create_bs_dev(bdev); + g_bs_dev = spdk_bdev_create_bs_dev(bdev, NULL, NULL); printf("Mounting BlobFS on bdev %s\n", spdk_bdev_get_name(bdev)); } diff --git a/test/lib/blobfs/mkfs/mkfs.c b/test/lib/blobfs/mkfs/mkfs.c index 01f4edbd41..457abdf2e5 100644 --- a/test/lib/blobfs/mkfs/mkfs.c +++ b/test/lib/blobfs/mkfs/mkfs.c @@ -81,7 +81,7 @@ spdk_mkfs_run(void *arg1, void *arg2) printf("Initializing filesystem on bdev %s...", g_bdev_name); fflush(stdout); - g_bs_dev = spdk_bdev_create_bs_dev(bdev); + g_bs_dev = spdk_bdev_create_bs_dev(bdev, NULL, NULL); spdk_fs_init(g_bs_dev, NULL, init_cb, NULL); } diff --git a/test/unit/lib/bdev/vbdev_lvol.c/vbdev_lvol_ut.c b/test/unit/lib/bdev/vbdev_lvol.c/vbdev_lvol_ut.c index 1ee2783cc3..c0e45bbbeb 100644 --- a/test/unit/lib/bdev/vbdev_lvol.c/vbdev_lvol_ut.c +++ b/test/unit/lib/bdev/vbdev_lvol.c/vbdev_lvol_ut.c @@ -78,7 +78,7 @@ bdev_blob_destroy(struct spdk_bs_dev *bs_dev) } struct spdk_bs_dev * -spdk_bdev_create_bs_dev(struct spdk_bdev *bdev) +spdk_bdev_create_bs_dev(struct spdk_bdev *bdev, spdk_bdev_remove_cb_t remove_cb, void *remove_ctx) { struct spdk_bs_dev *bs_dev;