Commit 4ef41930 authored by Ben Walker's avatar Ben Walker Committed by Daniel Verkamp
Browse files

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: default avatarBen Walker <benjamin.walker@intel.com>
parent 1cbbfb86
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -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)
{
+2 −0
Original line number Diff line number Diff line
@@ -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;