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: Daniel Verkamp <daniel.verkamp@intel.com> Reviewed-on: https://review.gerrithub.io/363299 Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
1c7b6f8dab
commit
806644a05f
@ -192,7 +192,7 @@ nvmf_tgt_create_subsystem(const char *name, enum spdk_nvmf_subtype subtype,
|
|||||||
struct spdk_nvmf_subsystem *subsystem;
|
struct spdk_nvmf_subsystem *subsystem;
|
||||||
struct nvmf_tgt_subsystem *app_subsys;
|
struct nvmf_tgt_subsystem *app_subsys;
|
||||||
|
|
||||||
if (spdk_nvmf_subsystem_exists(name)) {
|
if (spdk_nvmf_find_subsystem(name)) {
|
||||||
SPDK_ERRLOG("Subsystem already exist\n");
|
SPDK_ERRLOG("Subsystem already exist\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -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);
|
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);
|
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,
|
struct spdk_nvmf_listen_addr *spdk_nvmf_tgt_listen(const char *trname, const char *traddr,
|
||||||
|
@ -45,24 +45,6 @@
|
|||||||
#include "spdk_internal/bdev.h"
|
#include "spdk_internal/bdev.h"
|
||||||
#include "spdk_internal/log.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 *
|
struct spdk_nvmf_subsystem *
|
||||||
spdk_nvmf_find_subsystem(const char *subnqn)
|
spdk_nvmf_find_subsystem(const char *subnqn)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user