nvmf: Add function to get subsystem by id

This isn't used anywhere yet, but it will be for
NVMe-oF 1.1.

Change-Id: Ieae0688e6ad5b7a44568e5760382b5716b02e6f0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Ben Walker 2017-01-13 15:11:00 -07:00 committed by Daniel Verkamp
parent 1cbbfb86fa
commit 4ef419305e
2 changed files with 19 additions and 0 deletions

View File

@ -87,6 +87,23 @@ nvmf_find_subsystem(const char *subnqn)
return NULL;
}
struct spdk_nvmf_subsystem *
spdk_nvmf_find_subsystem_with_cntlid(uint16_t cntlid)
{
struct spdk_nvmf_subsystem *subsystem;
struct spdk_nvmf_session *session;
TAILQ_FOREACH(subsystem, &g_subsystems, entries) {
TAILQ_FOREACH(session, &subsystem->sessions, link) {
if (session->cntlid == cntlid) {
return subsystem;
}
}
}
return NULL;
}
bool
spdk_nvmf_subsystem_host_allowed(struct spdk_nvmf_subsystem *subsystem, const char *hostnqn)
{

View File

@ -39,6 +39,8 @@
#include "spdk/nvme.h"
#include "spdk/nvmf.h"
struct spdk_nvmf_subsystem *spdk_nvmf_find_subsystem_with_cntlid(uint16_t cntlid);
void spdk_nvmf_get_discovery_log_page(void *buffer, uint64_t offset, uint32_t length);
extern const struct spdk_nvmf_ctrlr_ops spdk_nvmf_direct_ctrlr_ops;