From 21aa2ba37e4d68d0c75e04173446a7c3d4764990 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Thu, 24 Feb 2022 13:08:55 +0000 Subject: [PATCH] bdev/nvme: move discovery_attach_cb up in file It will be referenced in a second location in an upcoming patch, so move its definition now to reduce the size of that patch and avoid a forward declaration. Signed-off-by: Jim Harris Change-Id: Iae12cc613190c03f0d48d71475df98384f8e47c7 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11730 Community-CI: Broadcom CI Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins Reviewed-by: Aleksey Marchuk Reviewed-by: Shuhei Matsumoto --- module/bdev/nvme/bdev_nvme.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/module/bdev/nvme/bdev_nvme.c b/module/bdev/nvme/bdev_nvme.c index b8cdc1f5b..c68abca63 100644 --- a/module/bdev/nvme/bdev_nvme.c +++ b/module/bdev/nvme/bdev_nvme.c @@ -4382,6 +4382,21 @@ start_discovery_done(void *cb_ctx) } } +static void +discovery_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 discovery_ctx *ctx; + + ctx = SPDK_CONTAINEROF(user_opts, struct discovery_ctx, opts); + + SPDK_DEBUGLOG(bdev_nvme, "discovery ctrlr attached\n"); + ctx->probe_ctx = NULL; + ctx->ctrlr = ctrlr; + spdk_nvme_ctrlr_register_aer_callback(ctx->ctrlr, discovery_aer_cb, ctx); +} + static int discovery_poller(void *arg) { @@ -4425,21 +4440,6 @@ discovery_poller(void *arg) return SPDK_POLLER_BUSY; } -static void -discovery_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 discovery_ctx *ctx; - - ctx = SPDK_CONTAINEROF(user_opts, struct discovery_ctx, opts); - - SPDK_DEBUGLOG(bdev_nvme, "discovery ctrlr attached\n"); - ctx->probe_ctx = NULL; - ctx->ctrlr = ctrlr; - spdk_nvme_ctrlr_register_aer_callback(ctx->ctrlr, discovery_aer_cb, ctx); -} - static void start_discovery_poller(void *arg) {