lib/iscsi: Remove spdk_iscsi_conn_check_state

This patch will also re-export spdk_iscsi_conn_destruct

Change-Id: I7d6cbba33294c84398a919d888c8b375e901e09e
Signed-off-by: Ziye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/402485
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Ziye Yang 2018-03-06 12:46:55 +08:00 committed by Jim Harris
parent 76d023fd56
commit da9f21680b
3 changed files with 5 additions and 25 deletions

View File

@ -512,7 +512,7 @@ _spdk_iscsi_conn_check_shutdown(void *arg)
_spdk_iscsi_conn_free(conn);
}
static void
void
spdk_iscsi_conn_destruct(struct spdk_iscsi_conn *conn)
{
struct spdk_iscsi_tgt_node *target;
@ -1166,21 +1166,6 @@ spdk_iscsi_conn_sock_cb(void *arg, struct spdk_sock_group *group, struct spdk_so
}
}
static int
spdk_iscsi_conn_check_state(struct spdk_iscsi_conn *conn)
{
if (conn->state == ISCSI_CONN_STATE_EXITED) {
return -1;
}
if (conn->state == ISCSI_CONN_STATE_EXITING) {
spdk_iscsi_conn_destruct(conn);
return -1;
}
return 0;
}
static void
spdk_iscsi_conn_full_feature_migrate(void *arg1, void *arg2)
{
@ -1239,19 +1224,11 @@ spdk_iscsi_conn_migration(struct spdk_iscsi_conn *conn)
void
spdk_iscsi_conn_login_do_work(void *arg)
{
struct spdk_iscsi_conn *conn = arg;
/* iSCSI connection state check */
spdk_iscsi_conn_check_state(conn);
}
void
spdk_iscsi_conn_full_feature_do_work(void *arg)
{
struct spdk_iscsi_conn *conn = arg;
/* iSCSI connection state check */
spdk_iscsi_conn_check_state(conn);
}
void

View File

@ -173,6 +173,7 @@ int spdk_initialize_iscsi_conns(void);
void spdk_shutdown_iscsi_conns(void);
int spdk_iscsi_conn_construct(struct spdk_iscsi_portal *portal, struct spdk_sock *sock);
void spdk_iscsi_conn_destruct(struct spdk_iscsi_conn *conn);
void spdk_iscsi_conn_handle_nop(struct spdk_iscsi_conn *conn);
void spdk_iscsi_conn_migration(struct spdk_iscsi_conn *conn);
void spdk_iscsi_conn_logout(struct spdk_iscsi_conn *conn);

View File

@ -846,7 +846,9 @@ spdk_iscsi_poll_group_poll(void *ctx)
}
STAILQ_FOREACH_SAFE(conn, &group->connections, link, tmp) {
conn->fn(conn);
if (conn->state == ISCSI_CONN_STATE_EXITING) {
spdk_iscsi_conn_destruct(conn);
}
}
}