nvme: add internal function to iterate over transports.
This will come in handy in the new poll group API. Change-Id: I9cf14082270b28b35f4a440c5cb2471c81e374ba Signed-off-by: Seth Howell <seth.howell@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/578 Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
19260848f6
commit
b1daf62be5
@ -1121,6 +1121,9 @@ struct spdk_nvme_ctrlr *spdk_nvme_get_ctrlr_by_trid_unsafe(
|
||||
const struct spdk_nvme_transport_id *trid);
|
||||
|
||||
const struct spdk_nvme_transport *nvme_get_transport(const char *transport_name);
|
||||
const struct spdk_nvme_transport *nvme_get_first_transport(void);
|
||||
const struct spdk_nvme_transport *nvme_get_next_transport(const struct spdk_nvme_transport
|
||||
*transport);
|
||||
|
||||
/* Transport specific functions */
|
||||
struct spdk_nvme_ctrlr *nvme_transport_ctrlr_construct(const struct spdk_nvme_transport_id *trid,
|
||||
|
@ -46,6 +46,18 @@ struct spdk_nvme_transport {
|
||||
TAILQ_HEAD(nvme_transport_list, spdk_nvme_transport) g_spdk_nvme_transports =
|
||||
TAILQ_HEAD_INITIALIZER(g_spdk_nvme_transports);
|
||||
|
||||
const struct spdk_nvme_transport *
|
||||
nvme_get_first_transport(void)
|
||||
{
|
||||
return TAILQ_FIRST(&g_spdk_nvme_transports);
|
||||
}
|
||||
|
||||
const struct spdk_nvme_transport *
|
||||
nvme_get_next_transport(const struct spdk_nvme_transport *transport)
|
||||
{
|
||||
return TAILQ_NEXT(transport, link);
|
||||
}
|
||||
|
||||
/*
|
||||
* Unfortunately, due to NVMe PCIe multiprocess support, we cannot store the
|
||||
* transport object in either the controller struct or the admin qpair. THis means
|
||||
|
Loading…
Reference in New Issue
Block a user