bdev/nvme: nvme_ctrlr_create() gets prchk_flags from nvme_async_probe_ctx
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: Id3deca8e0aba23299347a6aee6f0f44ee683556e Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10555 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
This commit is contained in:
parent
619acff501
commit
215518069a
@ -3180,7 +3180,6 @@ static int
|
||||
nvme_ctrlr_create(struct spdk_nvme_ctrlr *ctrlr,
|
||||
const char *name,
|
||||
const struct spdk_nvme_transport_id *trid,
|
||||
uint32_t prchk_flags,
|
||||
struct nvme_async_probe_ctx *ctx)
|
||||
{
|
||||
struct nvme_ctrlr *nvme_ctrlr;
|
||||
@ -3229,7 +3228,9 @@ nvme_ctrlr_create(struct spdk_nvme_ctrlr *ctrlr,
|
||||
goto err;
|
||||
}
|
||||
|
||||
nvme_ctrlr->prchk_flags = prchk_flags;
|
||||
if (ctx != NULL) {
|
||||
nvme_ctrlr->prchk_flags = ctx->prchk_flags;
|
||||
}
|
||||
|
||||
nvme_ctrlr->adminq_timer_poller = SPDK_POLLER_REGISTER(bdev_nvme_poll_adminq, nvme_ctrlr,
|
||||
g_opts.nvme_adminq_poll_period_us);
|
||||
@ -3287,7 +3288,7 @@ attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
|
||||
|
||||
SPDK_DEBUGLOG(bdev_nvme, "Attached to %s (%s)\n", trid->traddr, name);
|
||||
|
||||
nvme_ctrlr_create(ctrlr, name, trid, 0, NULL);
|
||||
nvme_ctrlr_create(ctrlr, name, trid, NULL);
|
||||
|
||||
free(name);
|
||||
}
|
||||
@ -3631,7 +3632,7 @@ connect_attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid,
|
||||
ctx = SPDK_CONTAINEROF(user_opts, struct nvme_async_probe_ctx, opts);
|
||||
ctx->ctrlr_attached = true;
|
||||
|
||||
rc = nvme_ctrlr_create(ctrlr, ctx->base_name, &ctx->trid, ctx->prchk_flags, ctx);
|
||||
rc = nvme_ctrlr_create(ctrlr, ctx->base_name, &ctx->trid, ctx);
|
||||
if (rc != 0) {
|
||||
populate_namespaces_cb(ctx, 0, rc);
|
||||
}
|
||||
|
@ -1194,7 +1194,7 @@ test_create_ctrlr(void)
|
||||
|
||||
ut_init_trid(&trid);
|
||||
|
||||
rc = nvme_ctrlr_create(&ctrlr, "nvme0", &trid, 0, NULL);
|
||||
rc = nvme_ctrlr_create(&ctrlr, "nvme0", &trid, NULL);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
CU_ASSERT(nvme_ctrlr_get_by_name("nvme0") != NULL);
|
||||
@ -1227,7 +1227,7 @@ test_reset_ctrlr(void)
|
||||
|
||||
set_thread(0);
|
||||
|
||||
rc = nvme_ctrlr_create(&ctrlr, "nvme0", &trid, 0, NULL);
|
||||
rc = nvme_ctrlr_create(&ctrlr, "nvme0", &trid, NULL);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
nvme_ctrlr = nvme_ctrlr_get_by_name("nvme0");
|
||||
@ -1339,7 +1339,7 @@ test_race_between_reset_and_destruct_ctrlr(void)
|
||||
|
||||
set_thread(0);
|
||||
|
||||
rc = nvme_ctrlr_create(&ctrlr, "nvme0", &trid, 0, NULL);
|
||||
rc = nvme_ctrlr_create(&ctrlr, "nvme0", &trid, NULL);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
nvme_ctrlr = nvme_ctrlr_get_by_name("nvme0");
|
||||
@ -1418,7 +1418,7 @@ test_failover_ctrlr(void)
|
||||
|
||||
set_thread(0);
|
||||
|
||||
rc = nvme_ctrlr_create(&ctrlr, "nvme0", &trid1, 0, NULL);
|
||||
rc = nvme_ctrlr_create(&ctrlr, "nvme0", &trid1, NULL);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
nvme_ctrlr = nvme_ctrlr_get_by_name("nvme0");
|
||||
@ -2484,7 +2484,7 @@ test_get_io_qpair(void)
|
||||
|
||||
set_thread(0);
|
||||
|
||||
rc = nvme_ctrlr_create(&ctrlr, "nvme0", &trid, 0, NULL);
|
||||
rc = nvme_ctrlr_create(&ctrlr, "nvme0", &trid, NULL);
|
||||
CU_ASSERT(rc == 0);
|
||||
|
||||
nvme_ctrlr = nvme_ctrlr_get_by_name("nvme0");
|
||||
|
Loading…
Reference in New Issue
Block a user