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:
parent
13935275fb
commit
d72f73b26e
@ -580,7 +580,7 @@ spdk_iscsi_conn_destruct(struct spdk_iscsi_conn *conn)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
iscsi_get_active_conns(void)
|
iscsi_get_active_conns(struct spdk_iscsi_tgt_node *target)
|
||||||
{
|
{
|
||||||
struct spdk_iscsi_conn *conn;
|
struct spdk_iscsi_conn *conn;
|
||||||
int num = 0;
|
int num = 0;
|
||||||
@ -592,6 +592,9 @@ iscsi_get_active_conns(void)
|
|||||||
if (conn == NULL) {
|
if (conn == NULL) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (target != NULL && conn->target != target) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
num++;
|
num++;
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&g_conns_mutex);
|
pthread_mutex_unlock(&g_conns_mutex);
|
||||||
@ -623,7 +626,7 @@ iscsi_conn_check_shutdown(void *arg)
|
|||||||
{
|
{
|
||||||
struct spdk_event *event;
|
struct spdk_event *event;
|
||||||
|
|
||||||
if (iscsi_get_active_conns() != 0) {
|
if (iscsi_get_active_conns(NULL) != 0) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user