lib/vhost: Remove and inline spdk_vhost_blk_get_dev

Having spdk_vhost_blk_get_dev required us to bump up the SO version
the vhost library when we updated bdev.h but spdk_vhost_blk_get_dev
has not been used publicly, and can be inlined very simply.

So remove spdk_vhost_blk_get_dev from include/spdk/vhost.h and inline
it to the place which had used it.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I98c233b81d7980d4e2c5bd3c0a65d747f183e1e9
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/2747
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
This commit is contained in:
Shuhei Matsumoto 2020-06-03 07:13:48 +09:00 committed by Tomasz Zawadzki
parent 18450e8b82
commit b62bfbf6a9
5 changed files with 9 additions and 24 deletions

View File

@ -50,6 +50,10 @@ options. Options can be set independently for each implementation.
Added `recv_buf_size` and 'send_buf_size' socket layer options. They are used only in posix implementation.
### vhost
The function `spdk_vhost_blk_get_dev` has been removed.
## v20.04:
IDXD engine support for compare has been added.

View File

@ -330,16 +330,6 @@ int spdk_vhost_blk_construct(const char *name, const char *cpumask, const char *
*/
int spdk_vhost_dev_remove(struct spdk_vhost_dev *vdev);
/**
* Get underlying SPDK bdev from vhost blk device. The bdev might be NULL, as it
* could have been hotremoved.
*
* \param ctrlr vhost blk device.
*
* \return SPDK bdev associated with given vdev.
*/
struct spdk_bdev *spdk_vhost_blk_get_dev(struct spdk_vhost_dev *ctrlr);
#ifdef __cplusplus
}
#endif

View File

@ -34,7 +34,7 @@
SPDK_ROOT_DIR := $(abspath $(CURDIR)/../..)
include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
SO_VER := 3
SO_VER := 4
SO_MINOR := 0
CFLAGS += -I.

View File

@ -22,7 +22,6 @@
spdk_vhost_scsi_dev_remove_tgt;
spdk_vhost_blk_construct;
spdk_vhost_dev_remove;
spdk_vhost_blk_get_dev;
local: *;
};

View File

@ -801,15 +801,6 @@ to_blk_dev(struct spdk_vhost_dev *vdev)
return SPDK_CONTAINEROF(vdev, struct spdk_vhost_blk_dev, vdev);
}
struct spdk_bdev *
spdk_vhost_blk_get_dev(struct spdk_vhost_dev *vdev)
{
struct spdk_vhost_blk_dev *bvdev = to_blk_dev(vdev);
assert(bvdev != NULL);
return bvdev->bdev;
}
static void
vhost_dev_bdev_remove_cpl_cb(struct spdk_vhost_dev *vdev, void *ctx)
{
@ -1031,18 +1022,18 @@ vhost_blk_stop(struct spdk_vhost_session *vsession)
static void
vhost_blk_dump_info_json(struct spdk_vhost_dev *vdev, struct spdk_json_write_ctx *w)
{
struct spdk_bdev *bdev = spdk_vhost_blk_get_dev(vdev);
struct spdk_vhost_blk_dev *bvdev;
bvdev = to_blk_dev(vdev);
assert(bvdev != NULL);
spdk_json_write_named_object_begin(w, "block");
spdk_json_write_named_bool(w, "readonly", bvdev->readonly);
spdk_json_write_name(w, "bdev");
if (bdev) {
spdk_json_write_string(w, spdk_bdev_get_name(bdev));
if (bvdev->bdev) {
spdk_json_write_string(w, spdk_bdev_get_name(bvdev->bdev));
} else {
spdk_json_write_null(w);
}
@ -1057,6 +1048,7 @@ vhost_blk_write_config_json(struct spdk_vhost_dev *vdev, struct spdk_json_write_
bvdev = to_blk_dev(vdev);
assert(bvdev != NULL);
if (!bvdev->bdev) {
return;
}