bdev/nvme: Pass nvme_bdev_ctrlr simply to bdev_nvme_add_trid()
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: I4ee5ec24f553d03e784b28b1d252f77a73c06ec8 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/4389 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
96dbd5e427
commit
66e85c204c
@ -1774,9 +1774,8 @@ bdev_nvme_async_poll(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
bdev_nvme_add_trid(const char *name, struct spdk_nvme_transport_id *trid)
|
bdev_nvme_add_trid(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr, struct spdk_nvme_transport_id *trid)
|
||||||
{
|
{
|
||||||
struct nvme_bdev_ctrlr *nvme_bdev_ctrlr;
|
|
||||||
struct spdk_nvme_ctrlr *new_ctrlr;
|
struct spdk_nvme_ctrlr *new_ctrlr;
|
||||||
struct spdk_nvme_ctrlr_opts opts;
|
struct spdk_nvme_ctrlr_opts opts;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
@ -1785,13 +1784,7 @@ bdev_nvme_add_trid(const char *name, struct spdk_nvme_transport_id *trid)
|
|||||||
struct nvme_bdev_ctrlr_trid *new_trid;
|
struct nvme_bdev_ctrlr_trid *new_trid;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
assert(name != NULL);
|
assert(nvme_bdev_ctrlr != NULL);
|
||||||
|
|
||||||
nvme_bdev_ctrlr = nvme_bdev_ctrlr_get_by_name(name);
|
|
||||||
if (nvme_bdev_ctrlr == NULL) {
|
|
||||||
SPDK_ERRLOG("Failed to find NVMe controller\n");
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Currently we only support failover to the same transport type. */
|
/* Currently we only support failover to the same transport type. */
|
||||||
if (nvme_bdev_ctrlr->connected_trid->trtype != trid->trtype) {
|
if (nvme_bdev_ctrlr->connected_trid->trtype != trid->trtype) {
|
||||||
@ -1942,7 +1935,7 @@ bdev_nvme_create(struct spdk_nvme_transport_id *trid,
|
|||||||
free(ctx);
|
free(ctx);
|
||||||
return -EEXIST;
|
return -EEXIST;
|
||||||
}
|
}
|
||||||
rc = bdev_nvme_add_trid(existing_ctrlr->name, trid);
|
rc = bdev_nvme_add_trid(existing_ctrlr, trid);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
free(ctx);
|
free(ctx);
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
Reference in New Issue
Block a user