diff --git a/module/bdev/nvme/bdev_nvme.c b/module/bdev/nvme/bdev_nvme.c index 1f9961cab..7e87a55f8 100644 --- a/module/bdev/nvme/bdev_nvme.c +++ b/module/bdev/nvme/bdev_nvme.c @@ -925,25 +925,27 @@ bdev_nvme_dump_info_json(void *ctx, struct spdk_json_write_ctx *w) struct nvme_bdev *nvme_bdev = ctx; struct nvme_bdev_ctrlr *nvme_bdev_ctrlr = nvme_bdev->nvme_ns->ctrlr; const struct spdk_nvme_ctrlr_data *cdata; + const struct spdk_nvme_transport_id *trid; struct spdk_nvme_ns *ns; union spdk_nvme_vs_register vs; union spdk_nvme_csts_register csts; char buf[128]; cdata = spdk_nvme_ctrlr_get_data(nvme_bdev_ctrlr->ctrlr); + trid = spdk_nvme_ctrlr_get_transport_id(nvme_bdev_ctrlr->ctrlr); vs = spdk_nvme_ctrlr_get_regs_vs(nvme_bdev_ctrlr->ctrlr); csts = spdk_nvme_ctrlr_get_regs_csts(nvme_bdev_ctrlr->ctrlr); ns = nvme_bdev->nvme_ns->ns; spdk_json_write_named_object_begin(w, "nvme"); - if (nvme_bdev_ctrlr->connected_trid->trtype == SPDK_NVME_TRANSPORT_PCIE) { - spdk_json_write_named_string(w, "pci_address", nvme_bdev_ctrlr->connected_trid->traddr); + if (trid->trtype == SPDK_NVME_TRANSPORT_PCIE) { + spdk_json_write_named_string(w, "pci_address", trid->traddr); } spdk_json_write_named_object_begin(w, "trid"); - nvme_bdev_dump_trid_json(nvme_bdev_ctrlr->connected_trid, w); + nvme_bdev_dump_trid_json(trid, w); spdk_json_write_object_end(w); diff --git a/module/bdev/nvme/common.c b/module/bdev/nvme/common.c index b1a7dee77..3faaeecd7 100644 --- a/module/bdev/nvme/common.c +++ b/module/bdev/nvme/common.c @@ -84,7 +84,7 @@ nvme_bdev_next_ctrlr(struct nvme_bdev_ctrlr *prev) } void -nvme_bdev_dump_trid_json(struct spdk_nvme_transport_id *trid, struct spdk_json_write_ctx *w) +nvme_bdev_dump_trid_json(const struct spdk_nvme_transport_id *trid, struct spdk_json_write_ctx *w) { const char *trtype_str; const char *adrfam_str; diff --git a/module/bdev/nvme/common.h b/module/bdev/nvme/common.h index 159911ed9..79657c200 100644 --- a/module/bdev/nvme/common.h +++ b/module/bdev/nvme/common.h @@ -160,7 +160,7 @@ struct nvme_bdev_ctrlr *nvme_bdev_ctrlr_get_by_name(const char *name); struct nvme_bdev_ctrlr *nvme_bdev_first_ctrlr(void); struct nvme_bdev_ctrlr *nvme_bdev_next_ctrlr(struct nvme_bdev_ctrlr *prev); -void nvme_bdev_dump_trid_json(struct spdk_nvme_transport_id *trid, +void nvme_bdev_dump_trid_json(const struct spdk_nvme_transport_id *trid, struct spdk_json_write_ctx *w); int nvme_bdev_ctrlr_destruct(struct nvme_bdev_ctrlr *nvme_bdev_ctrlr);