iscsi: Remove the variable ntargets from iscsi global params

The variable ntargets in the struct spdk_iscsi_globals was needed
previously because iSCSI target node was managed by a fixed size
array.

Now iSCSI target node is managed by a linked list and ntargets
doesn't take any meaningful role now.

Change-Id: I1805d7a6a6ce40efa4d18f198fbb9104bee43b26
Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/402976
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
Shuhei Matsumoto 2018-03-07 08:10:56 +09:00 committed by Daniel Verkamp
parent d4d33783ee
commit 230833d8ce
2 changed files with 0 additions and 5 deletions

View File

@ -271,7 +271,6 @@ struct spdk_iscsi_globals {
TAILQ_HEAD(, spdk_iscsi_portal) portal_head;
TAILQ_HEAD(, spdk_iscsi_portal_grp) pg_head;
TAILQ_HEAD(, spdk_iscsi_init_grp) ig_head;
int ntargets;
TAILQ_HEAD(, spdk_iscsi_tgt_node) target_head;
int timeout;

View File

@ -391,7 +391,6 @@ spdk_iscsi_send_tgts(struct spdk_iscsi_conn *conn, const char *iiqn,
static void
spdk_iscsi_tgt_node_list_init(void)
{
g_spdk_iscsi.ntargets = 0;
TAILQ_INIT(&g_spdk_iscsi.target_head);
}
@ -423,7 +422,6 @@ spdk_iscsi_tgt_node_register(struct spdk_iscsi_tgt_node *target)
}
TAILQ_INSERT_TAIL(&g_spdk_iscsi.target_head, target, tailq);
g_spdk_iscsi.ntargets++;
pthread_mutex_unlock(&g_spdk_iscsi.mutex);
return 0;
@ -437,7 +435,6 @@ spdk_iscsi_tgt_node_unregister(struct spdk_iscsi_tgt_node *target)
TAILQ_FOREACH(t, &g_spdk_iscsi.target_head, tailq) {
if (t == target) {
TAILQ_REMOVE(&g_spdk_iscsi.target_head, t, tailq);
g_spdk_iscsi.ntargets--;
return 0;
}
}
@ -1238,7 +1235,6 @@ spdk_iscsi_shutdown_tgt_nodes(void)
pthread_mutex_lock(&g_spdk_iscsi.mutex);
TAILQ_FOREACH_SAFE(target, &g_spdk_iscsi.target_head, tailq, tmp) {
TAILQ_REMOVE(&g_spdk_iscsi.target_head, target, tailq);
g_spdk_iscsi.ntargets--;
spdk_iscsi_tgt_node_destruct(target);
}
pthread_mutex_unlock(&g_spdk_iscsi.mutex);