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 <james.r.harris@intel.com> Change-Id: Iae12cc613190c03f0d48d71475df98384f8e47c7 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11730 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com>
This commit is contained in:
parent
d98c37495a
commit
21aa2ba37e
@ -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
|
static int
|
||||||
discovery_poller(void *arg)
|
discovery_poller(void *arg)
|
||||||
{
|
{
|
||||||
@ -4425,21 +4440,6 @@ discovery_poller(void *arg)
|
|||||||
return SPDK_POLLER_BUSY;
|
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
|
static void
|
||||||
start_discovery_poller(void *arg)
|
start_discovery_poller(void *arg)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user