nvmf: remove unnecessary subsystem num_hosts field

Change-Id: Ic1b7b1b6497dbae5ceda9bb91f9d4d2037b7243f
Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
Reviewed-on: https://review.gerrithub.io/363301
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
Daniel Verkamp 2017-05-31 16:32:42 -07:00 committed by Ben Walker
parent 63b76fe194
commit 77db92cf38
2 changed files with 1 additions and 4 deletions

View File

@ -126,7 +126,6 @@ struct spdk_nvmf_subsystem {
TAILQ_HEAD(, spdk_nvmf_session) sessions;
TAILQ_HEAD(, spdk_nvmf_host) hosts;
uint32_t num_hosts;
TAILQ_HEAD(, spdk_nvmf_subsystem_allowed_listener) allowed_listeners;

View File

@ -89,7 +89,7 @@ spdk_nvmf_subsystem_host_allowed(struct spdk_nvmf_subsystem *subsystem, const ch
return false;
}
if (subsystem->num_hosts == 0) {
if (TAILQ_EMPTY(&subsystem->hosts)) {
/* No hosts means any host can connect */
return true;
}
@ -247,7 +247,6 @@ spdk_nvmf_delete_subsystem(struct spdk_nvmf_subsystem *subsystem)
TAILQ_REMOVE(&subsystem->hosts, host, link);
free(host->nqn);
free(host);
subsystem->num_hosts--;
}
TAILQ_FOREACH_SAFE(session, &subsystem->sessions, link, session_tmp) {
@ -363,7 +362,6 @@ spdk_nvmf_subsystem_add_host(struct spdk_nvmf_subsystem *subsystem, const char *
}
TAILQ_INSERT_HEAD(&subsystem->hosts, host, link);
subsystem->num_hosts++;
g_nvmf_tgt.discovery_genctr++;
return 0;