bdev: Move spdk_bdev_get_by_name() up in a file

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Ia081edc6d04f2293296d61ec2f229f9823149bbf
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/8522
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Ziye Yang <ziye.yang@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>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
This commit is contained in:
Shuhei Matsumoto 2021-06-26 11:29:55 +09:00 committed by Tomasz Zawadzki
parent ac3a42b15c
commit 680388d45d

View File

@ -475,6 +475,21 @@ spdk_bdev_set_opts(struct spdk_bdev_opts *opts)
return 0;
}
struct spdk_bdev *
spdk_bdev_get_by_name(const char *bdev_name)
{
struct spdk_bdev_name find;
struct spdk_bdev_name *res;
find.name = (char *)bdev_name;
res = RB_FIND(bdev_name_tree, &g_bdev_mgr.bdev_names, &find);
if (res != NULL) {
return res->bdev;
}
return NULL;
}
struct spdk_bdev_wait_for_examine_ctx {
struct spdk_poller *poller;
spdk_bdev_wait_for_examine_cb cb_fn;
@ -725,21 +740,6 @@ spdk_bdev_next_leaf(struct spdk_bdev *prev)
return bdev;
}
struct spdk_bdev *
spdk_bdev_get_by_name(const char *bdev_name)
{
struct spdk_bdev_name find;
struct spdk_bdev_name *res;
find.name = (char *)bdev_name;
res = RB_FIND(bdev_name_tree, &g_bdev_mgr.bdev_names, &find);
if (res != NULL) {
return res->bdev;
}
return NULL;
}
void
spdk_bdev_io_set_buf(struct spdk_bdev_io *bdev_io, void *buf, size_t len)
{