From ed35ca1de16f12b0f28385238f68be52856c7adf Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Tue, 26 Nov 2019 11:43:51 -0700 Subject: [PATCH] bdev/nvme: remove bdev_nvme_populate_namespaces This function can now be easily moved inline to its single caller. Signed-off-by: Jim Harris Change-Id: I55a20dfb9f6cdeee2541b02b63fd5422786c551c Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/475925 Tested-by: SPDK CI Jenkins Reviewed-by: Shuhei Matsumoto Reviewed-by: Tomasz Zawadzki Reviewed-by: Changpeng Liu Reviewed-by: Konrad Sztyber Reviewed-by: Ben Walker --- module/bdev/nvme/bdev_nvme.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) 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