Commit d72f73b2 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Ben Walker
Browse files

lib/iscsi: Add target to get_active_conns() as an argument



Subsequent patches will exit only connections belonging to the
specific target node. So add target to get_active_conns() as
an argument.

Change-Id: If0d9cad46614310e0fe17e69e75c1185146730f4
Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450735


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 13935275
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -580,7 +580,7 @@ spdk_iscsi_conn_destruct(struct spdk_iscsi_conn *conn)
}

static int
iscsi_get_active_conns(void)
iscsi_get_active_conns(struct spdk_iscsi_tgt_node *target)
{
	struct spdk_iscsi_conn *conn;
	int num = 0;
@@ -592,6 +592,9 @@ iscsi_get_active_conns(void)
		if (conn == NULL) {
			continue;
		}
		if (target != NULL && conn->target != target) {
			continue;
		}
		num++;
	}
	pthread_mutex_unlock(&g_conns_mutex);
@@ -623,7 +626,7 @@ iscsi_conn_check_shutdown(void *arg)
{
	struct spdk_event *event;

	if (iscsi_get_active_conns() != 0) {
	if (iscsi_get_active_conns(NULL) != 0) {
		return 1;
	}