Commit 806644a0 authored by Daniel Verkamp's avatar Daniel Verkamp Committed by Ben Walker
Browse files

nvmf: remove spdk_nvmf_subsystem_exists()



spdk_nvmf_subsystem_exists(nqn) is exactly equivalent to
spdk_nvmf_find_subsystem(nqn) != NULL.

Change-Id: Icafa43166c99d1364b49cef30a5ade4b6625bcd5
Signed-off-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363299


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
parent 1c7b6f8d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ nvmf_tgt_create_subsystem(const char *name, enum spdk_nvmf_subtype subtype,
	struct spdk_nvmf_subsystem *subsystem;
	struct nvmf_tgt_subsystem *app_subsys;

	if (spdk_nvmf_subsystem_exists(name)) {
	if (spdk_nvmf_find_subsystem(name)) {
		SPDK_ERRLOG("Subsystem already exist\n");
		return NULL;
	}
+0 −2
Original line number Diff line number Diff line
@@ -152,8 +152,6 @@ void spdk_nvmf_delete_subsystem(struct spdk_nvmf_subsystem *subsystem);

struct spdk_nvmf_subsystem *spdk_nvmf_find_subsystem(const char *subnqn);

bool spdk_nvmf_subsystem_exists(const char *subnqn);

bool spdk_nvmf_subsystem_host_allowed(struct spdk_nvmf_subsystem *subsystem, const char *hostnqn);

struct spdk_nvmf_listen_addr *spdk_nvmf_tgt_listen(const char *trname, const char *traddr,
+0 −18
Original line number Diff line number Diff line
@@ -45,24 +45,6 @@
#include "spdk_internal/bdev.h"
#include "spdk_internal/log.h"

bool
spdk_nvmf_subsystem_exists(const char *subnqn)
{
	struct spdk_nvmf_subsystem	*subsystem;

	if (!subnqn) {
		return false;
	}

	TAILQ_FOREACH(subsystem, &g_nvmf_tgt.subsystems, entries) {
		if (strcmp(subnqn, subsystem->subnqn) == 0) {
			return true;
		}
	}

	return false;
}

struct spdk_nvmf_subsystem *
spdk_nvmf_find_subsystem(const char *subnqn)
{