Commit da9f2168 authored by Ziye Yang's avatar Ziye Yang Committed by Jim Harris
Browse files

lib/iscsi: Remove spdk_iscsi_conn_check_state



This patch will also re-export spdk_iscsi_conn_destruct

Change-Id: I7d6cbba33294c84398a919d888c8b375e901e09e
Signed-off-by: default avatarZiye Yang <optimistyzy@gmail.com>
Reviewed-on: https://review.gerrithub.io/402485


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 76d023fd
Loading
Loading
Loading
Loading
+1 −24
Original line number Diff line number Diff line
@@ -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
+1 −0
Original line number Diff line number Diff line
@@ -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);
+3 −1
Original line number Diff line number Diff line
@@ -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);
		}
	}
}