diff --git a/module/bdev/nvme/bdev_nvme.c b/module/bdev/nvme/bdev_nvme.c index 1fbb19ff9..67115a029 100644 --- a/module/bdev/nvme/bdev_nvme.c +++ b/module/bdev/nvme/bdev_nvme.c @@ -1698,6 +1698,23 @@ aer_cb(void *arg, const struct spdk_nvme_cpl *cpl) } } +static void +populate_namespaces_cb(struct nvme_async_probe_ctx *ctx, size_t count, int rc) +{ + if (ctx->cb_fn) { + ctx->cb_fn(ctx->cb_ctx, count, rc); + } + + ctx->namespaces_populated = true; + if (ctx->probe_done) { + /* The probe was already completed, so we need to free the context + * here. This can happen for cases like OCSSD, where we need to + * send additional commands to the SSD after attach. + */ + free(ctx); + } +} + static int nvme_bdev_ctrlr_create(struct spdk_nvme_ctrlr *ctrlr, const char *name, @@ -2019,23 +2036,6 @@ bdev_nvme_set_hotplug(bool enabled, uint64_t period_us, spdk_msg_fn cb, void *cb return 0; } -static void -populate_namespaces_cb(struct nvme_async_probe_ctx *ctx, size_t count, int rc) -{ - if (ctx->cb_fn) { - ctx->cb_fn(ctx->cb_ctx, count, rc); - } - - ctx->namespaces_populated = true; - if (ctx->probe_done) { - /* The probe was already completed, so we need to free the context - * here. This can happen for cases like OCSSD, where we need to - * send additional commands to the SSD after attach. - */ - free(ctx); - } -} - static void nvme_ctrlr_populate_namespaces_done(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr, struct nvme_async_probe_ctx *ctx)