diff --git a/module/bdev/nvme/bdev_nvme.c b/module/bdev/nvme/bdev_nvme.c index 478c3b61d..fcb14a0dc 100644 --- a/module/bdev/nvme/bdev_nvme.c +++ b/module/bdev/nvme/bdev_nvme.c @@ -1425,22 +1425,12 @@ nvme_ctrlr_populate_namespaces_done(struct nvme_async_probe_ctx *ctx) populate_namespaces_cb(ctx, j, 0); } -static void -bdev_nvme_populate_namespaces(struct nvme_async_probe_ctx *ctx) -{ - struct nvme_bdev_ctrlr *nvme_bdev_ctrlr; - - nvme_bdev_ctrlr = nvme_bdev_ctrlr_get(&ctx->trid); - assert(nvme_bdev_ctrlr != NULL); - - nvme_ctrlr_populate_namespaces(nvme_bdev_ctrlr, ctx); -} - static void connect_attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid, struct spdk_nvme_ctrlr *ctrlr, const struct spdk_nvme_ctrlr_opts *opts) { struct spdk_nvme_ctrlr_opts *user_opts = cb_ctx; + struct nvme_bdev_ctrlr *nvme_bdev_ctrlr; struct nvme_async_probe_ctx *ctx; int rc; @@ -1455,7 +1445,10 @@ connect_attach_cb(void *cb_ctx, const struct spdk_nvme_transport_id *trid, return; } - bdev_nvme_populate_namespaces(ctx); + nvme_bdev_ctrlr = nvme_bdev_ctrlr_get(&ctx->trid); + assert(nvme_bdev_ctrlr != NULL); + + nvme_ctrlr_populate_namespaces(nvme_bdev_ctrlr, ctx); } static int