diff --git a/lib/nvme/nvme.c b/lib/nvme/nvme.c index d7a58c7ab..2cf061097 100644 --- a/lib/nvme/nvme.c +++ b/lib/nvme/nvme.c @@ -311,7 +311,7 @@ nvme_ctrlr_probe(const struct spdk_nvme_transport_id *trid, void *devhandle, spdk_nvme_ctrlr_opts_set_defaults(&opts); if (probe_cb(cb_ctx, trid, &opts)) { - ctrlr = nvme_transport_ctrlr_construct(trid->trtype, &opts, trid, devhandle); + ctrlr = nvme_transport_ctrlr_construct(trid, &opts, devhandle); if (ctrlr == NULL) { SPDK_ERRLOG("Failed to construct NVMe controller\n"); return -1; diff --git a/lib/nvme/nvme_internal.h b/lib/nvme/nvme_internal.h index 7667b1528..f27fab18d 100644 --- a/lib/nvme/nvme_internal.h +++ b/lib/nvme/nvme_internal.h @@ -564,8 +564,8 @@ void nvme_qpair_print_completion(struct spdk_nvme_qpair *qpair, struct spdk_nvme /* Transport specific functions */ #define DECLARE_TRANSPORT(name) \ - struct spdk_nvme_ctrlr *nvme_ ## name ## _ctrlr_construct(enum spdk_nvme_transport_type trtype, const struct spdk_nvme_ctrlr_opts *opts, \ - const struct spdk_nvme_transport_id *trid, void *devhandle); \ + struct spdk_nvme_ctrlr *nvme_ ## name ## _ctrlr_construct(const struct spdk_nvme_transport_id *trid, const struct spdk_nvme_ctrlr_opts *opts, \ + void *devhandle); \ int nvme_ ## name ## _ctrlr_destruct(struct spdk_nvme_ctrlr *ctrlr); \ int nvme_ ## name ## _ctrlr_scan(const struct spdk_nvme_transport_id *trid, void *cb_ctx, spdk_nvme_probe_cb probe_cb, spdk_nvme_remove_cb remove_cb); \ int nvme_ ## name ## _ctrlr_attach(enum spdk_nvme_transport_type trtype, spdk_nvme_probe_cb probe_cb, void *cb_ctx, struct spdk_pci_addr *addr); \ diff --git a/lib/nvme/nvme_pcie.c b/lib/nvme/nvme_pcie.c index aca8ae615..7e0b11d0f 100644 --- a/lib/nvme/nvme_pcie.c +++ b/lib/nvme/nvme_pcie.c @@ -582,9 +582,8 @@ nvme_pcie_ctrlr_attach(enum spdk_nvme_transport_type trtype, return spdk_pci_nvme_device_attach(pcie_nvme_enum_cb, &enum_ctx, pci_addr); } -struct spdk_nvme_ctrlr *nvme_pcie_ctrlr_construct(enum spdk_nvme_transport_type trtype, +struct spdk_nvme_ctrlr *nvme_pcie_ctrlr_construct(const struct spdk_nvme_transport_id *trid, const struct spdk_nvme_ctrlr_opts *opts, - const struct spdk_nvme_transport_id *trid, void *devhandle) { struct spdk_pci_device *pci_dev = devhandle; diff --git a/lib/nvme/nvme_rdma.c b/lib/nvme/nvme_rdma.c index 081bc3d83..4b1bfe2e7 100644 --- a/lib/nvme/nvme_rdma.c +++ b/lib/nvme/nvme_rdma.c @@ -1070,9 +1070,7 @@ nvme_rdma_ctrlr_scan(const struct spdk_nvme_transport_id *discovery_trid, discovery_opts.keep_alive_timeout_ms = 0; memset(buffer, 0x0, 4096); - discovery_ctrlr = nvme_rdma_ctrlr_construct(SPDK_NVME_TRANSPORT_RDMA, &discovery_opts, - discovery_trid, - NULL); + discovery_ctrlr = nvme_rdma_ctrlr_construct(discovery_trid, &discovery_opts, NULL); if (discovery_ctrlr == NULL) { return -1; } @@ -1156,11 +1154,9 @@ nvme_rdma_ctrlr_attach(enum spdk_nvme_transport_type trtype, return -1; } -struct spdk_nvme_ctrlr * - nvme_rdma_ctrlr_construct(enum spdk_nvme_transport_type trtype, - const struct spdk_nvme_ctrlr_opts *opts, - const struct spdk_nvme_transport_id *trid, - void *devhandle) +struct spdk_nvme_ctrlr *nvme_rdma_ctrlr_construct(const struct spdk_nvme_transport_id *trid, + const struct spdk_nvme_ctrlr_opts *opts, + void *devhandle) { struct nvme_rdma_ctrlr *rctrlr; union spdk_nvme_cap_register cap; diff --git a/lib/nvme/nvme_transport.c b/lib/nvme/nvme_transport.c index c62109dcf..490b4ee84 100644 --- a/lib/nvme/nvme_transport.c +++ b/lib/nvme/nvme_transport.c @@ -81,13 +81,11 @@ spdk_nvme_transport_available(enum spdk_nvme_transport_type trtype) return false; } -struct spdk_nvme_ctrlr * - nvme_transport_ctrlr_construct(enum spdk_nvme_transport_type trtype, - const struct spdk_nvme_ctrlr_opts *opts, - const struct spdk_nvme_transport_id *trid, - void *devhandle) +struct spdk_nvme_ctrlr *nvme_transport_ctrlr_construct(const struct spdk_nvme_transport_id *trid, + const struct spdk_nvme_ctrlr_opts *opts, + void *devhandle) { - NVME_TRANSPORT_CALL(trtype, ctrlr_construct, (trtype, opts, trid, devhandle)); + NVME_TRANSPORT_CALL(trid->trtype, ctrlr_construct, (trid, opts, devhandle)); } int diff --git a/test/lib/nvme/unit/nvme_c/nvme_ut.c b/test/lib/nvme/unit/nvme_c/nvme_ut.c index 19432f642..73155f949 100644 --- a/test/lib/nvme/unit/nvme_c/nvme_ut.c +++ b/test/lib/nvme/unit/nvme_c/nvme_ut.c @@ -61,11 +61,9 @@ spdk_nvme_transport_available(enum spdk_nvme_transport_type trtype) return true; } -struct spdk_nvme_ctrlr * - nvme_transport_ctrlr_construct(enum spdk_nvme_transport_type trtype, - const struct spdk_nvme_ctrlr_opts *opts, - const struct spdk_nvme_transport_id *trid, - void *devhandle) +struct spdk_nvme_ctrlr *nvme_transport_ctrlr_construct(const struct spdk_nvme_transport_id *trid, + const struct spdk_nvme_ctrlr_opts *opts, + void *devhandle) { return NULL; } diff --git a/test/lib/nvme/unit/nvme_ctrlr_c/nvme_ctrlr_ut.c b/test/lib/nvme/unit/nvme_ctrlr_c/nvme_ctrlr_ut.c index 4c397d623..9918144fd 100644 --- a/test/lib/nvme/unit/nvme_ctrlr_c/nvme_ctrlr_ut.c +++ b/test/lib/nvme/unit/nvme_ctrlr_c/nvme_ctrlr_ut.c @@ -56,11 +56,9 @@ struct spdk_nvme_registers g_ut_nvme_regs = {}; __thread int nvme_thread_ioq_index = -1; -struct spdk_nvme_ctrlr * - nvme_transport_ctrlr_construct(enum spdk_nvme_transport_type trtype, - const struct spdk_nvme_ctrlr_opts *opts, - const struct spdk_nvme_transport_id *trid, - void *devhandle) +struct spdk_nvme_ctrlr *nvme_transport_ctrlr_construct(const struct spdk_nvme_transport_id *trid, + const struct spdk_nvme_ctrlr_opts *opts, + void *devhandle) { return NULL; } diff --git a/test/lib/nvme/unit/nvme_ns_cmd_c/nvme_ns_cmd_ut.c b/test/lib/nvme/unit/nvme_ns_cmd_c/nvme_ns_cmd_ut.c index c6051804d..d954894ae 100644 --- a/test/lib/nvme/unit/nvme_ns_cmd_c/nvme_ns_cmd_ut.c +++ b/test/lib/nvme/unit/nvme_ns_cmd_c/nvme_ns_cmd_ut.c @@ -75,11 +75,9 @@ spdk_nvme_transport_available(enum spdk_nvme_transport_type trtype) return true; } -struct spdk_nvme_ctrlr * - nvme_transport_ctrlr_construct(enum spdk_nvme_transport_type trtype, - const struct spdk_nvme_ctrlr_opts *opts, - const struct spdk_nvme_transport_id *trid, - void *devhandle) +struct spdk_nvme_ctrlr *nvme_transport_ctrlr_construct(const struct spdk_nvme_transport_id *trid, + const struct spdk_nvme_ctrlr_opts *opts, + void *devhandle) { return NULL; }