From 3e15b356f3fd62bc8b100b2da31c37bcebb46502 Mon Sep 17 00:00:00 2001 From: Tomasz Zawadzki Date: Tue, 2 Mar 2021 05:47:48 -0500 Subject: [PATCH] module/blob: remove deprecated spdk_bdev_create_bs_dev/from_desc() spdk_bdev_create_bs_dev was deprecated in SPDK 19.10 spdk_bdev_create_bs_dev_from_desc was deprecated in SPDK 20.10 Signed-off-by: Tomasz Zawadzki Change-Id: I1290958923f7833579d098a693454e7ab7656307 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/6624 Tested-by: SPDK CI Jenkins Community-CI: Mellanox Build Bot Reviewed-by: Aleksey Marchuk Reviewed-by: Ben Walker --- CHANGELOG.md | 4 ++++ include/spdk/blob_bdev.h | 21 ------------------ module/blob/bdev/blob_bdev.c | 43 ------------------------------------ 3 files changed, 4 insertions(+), 64 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b4d2568c0..681d42fc7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ For `bdev_ocssd_create` RPC, the optional parameter `range` was removed. Only one OCSSD bdev can be created for one OCSSD namespace. +### blobstore + +Removed the `spdk_bdev_create_bs_dev_from_desc` and `spdk_bdev_create_bs_dev` API. + ### env Added spdk_pci_device_allow API to allow applications to add PCI addresses to diff --git a/include/spdk/blob_bdev.h b/include/spdk/blob_bdev.h index fc2e4e7e4e..63ef053f1a 100644 --- a/include/spdk/blob_bdev.h +++ b/include/spdk/blob_bdev.h @@ -49,27 +49,6 @@ struct spdk_bs_dev; struct spdk_bdev; struct spdk_bdev_module; -/** - * Create a blobstore block device from a bdev (deprecated, please use spdk_bdev_create_bs_dev_ext). - * - * \param bdev Bdev to use. - * \param remove_cb Called when the block device is removed. - * \param remove_ctx Argument passed to function remove_cb. - * - * \return a pointer to the blobstore block device on success or NULL otherwise. - */ -struct spdk_bs_dev *spdk_bdev_create_bs_dev(struct spdk_bdev *bdev, spdk_bdev_remove_cb_t remove_cb, - void *remove_ctx); - -/** - * Create a blobstore block device from the descriptor of a bdev (deprecated, please use spdk_bdev_create_bs_dev_ext). - * - * \param desc Descriptor of a bdev. spdk_bdev_open_ext() is recommended to get the desc. - * - * \return a pointer to the blobstore block device on success or NULL otherwise. - */ -struct spdk_bs_dev *spdk_bdev_create_bs_dev_from_desc(struct spdk_bdev_desc *desc); - /** * Create a blobstore block device from a bdev. * diff --git a/module/blob/bdev/blob_bdev.c b/module/blob/bdev/blob_bdev.c index ffea54a7fb..1b788c5bf4 100644 --- a/module/blob/bdev/blob_bdev.c +++ b/module/blob/bdev/blob_bdev.c @@ -349,49 +349,6 @@ blob_bdev_init(struct blob_bdev *b, struct spdk_bdev_desc *desc) b->bs_dev.get_base_bdev = bdev_blob_get_base_bdev; } -struct spdk_bs_dev * -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; - int rc; - - b = calloc(1, sizeof(*b)); - - if (b == NULL) { - SPDK_ERRLOG("could not allocate blob_bdev\n"); - return NULL; - } - - rc = spdk_bdev_open(bdev, true, remove_cb, remove_ctx, &desc); - if (rc != 0) { - free(b); - return NULL; - } - - blob_bdev_init(b, desc); - - return &b->bs_dev; -} - -struct spdk_bs_dev * -spdk_bdev_create_bs_dev_from_desc(struct spdk_bdev_desc *desc) -{ - struct blob_bdev *b; - - b = calloc(1, sizeof(*b)); - - if (b == NULL) { - SPDK_ERRLOG("could not allocate blob_bdev\n"); - return NULL; - } - - blob_bdev_init(b, desc); - - return &b->bs_dev; -} - - int spdk_bdev_create_bs_dev_ext(const char *bdev_name, spdk_bdev_event_cb_t event_cb, void *event_ctx, struct spdk_bs_dev **_bs_dev)