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: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/450735
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Shuhei Matsumoto 2019-04-10 15:13:14 +09:00 committed by Ben Walker
parent 13935275fb
commit d72f73b26e

View File

@ -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;
}