diff --git a/include/spdk/nvmf_transport.h b/include/spdk/nvmf_transport.h index a6ca0407b..a3541d1e0 100644 --- a/include/spdk/nvmf_transport.h +++ b/include/spdk/nvmf_transport.h @@ -341,6 +341,16 @@ void spdk_nvmf_request_exec_fabrics(struct spdk_nvmf_request *req); int spdk_nvmf_request_free(struct spdk_nvmf_request *req); int spdk_nvmf_request_complete(struct spdk_nvmf_request *req); +/** + * Get the NVMe-oF subsystem associated with this controller. + * + * \param ctrlr The NVMe-oF controller + * + * \return The NVMe-oF subsystem + */ +struct spdk_nvmf_subsystem * +spdk_nvmf_ctrlr_get_subsystem(struct spdk_nvmf_ctrlr *ctrlr); + static inline enum spdk_nvme_data_transfer spdk_nvmf_req_get_xfer(struct spdk_nvmf_request *req) { enum spdk_nvme_data_transfer xfer; diff --git a/lib/nvmf/ctrlr.c b/lib/nvmf/ctrlr.c index 53c1de852..375870a31 100644 --- a/lib/nvmf/ctrlr.c +++ b/lib/nvmf/ctrlr.c @@ -3018,3 +3018,8 @@ void spdk_nvmf_request_get_data(struct spdk_nvmf_request *req, void **data, uint *data = req->data; *length = req->length; } + +struct spdk_nvmf_subsystem *spdk_nvmf_ctrlr_get_subsystem(struct spdk_nvmf_ctrlr *ctrlr) +{ + return ctrlr->subsys; +}