scsi: iscsi: Move iscsi_ep_disconnect()
[ Upstream commit c34f95e98d8fb750eefd4f3fe58b4f8b5e89253b ] This patch moves iscsi_ep_disconnect() so it can be called earlier in the next patch. Link: https://lore.kernel.org/r/20220408001314.5014-2-michael.christie@oracle.com Tested-by: Manish Rangankar <mrangankar@marvell.com> Reviewed-by: Lee Duncan <lduncan@suse.com> Reviewed-by: Chris Leech <cleech@redhat.com> Signed-off-by: Mike Christie <michael.christie@oracle.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
46f37a34a5
commit
699bd835c3
@@ -2239,6 +2239,25 @@ static void iscsi_stop_conn(struct iscsi_cls_conn *conn, int flag)
|
|||||||
ISCSI_DBG_TRANS_CONN(conn, "Stopping conn done.\n");
|
ISCSI_DBG_TRANS_CONN(conn, "Stopping conn done.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void iscsi_ep_disconnect(struct iscsi_cls_conn *conn, bool is_active)
|
||||||
|
{
|
||||||
|
struct iscsi_cls_session *session = iscsi_conn_to_session(conn);
|
||||||
|
struct iscsi_endpoint *ep;
|
||||||
|
|
||||||
|
ISCSI_DBG_TRANS_CONN(conn, "disconnect ep.\n");
|
||||||
|
conn->state = ISCSI_CONN_FAILED;
|
||||||
|
|
||||||
|
if (!conn->ep || !session->transport->ep_disconnect)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ep = conn->ep;
|
||||||
|
conn->ep = NULL;
|
||||||
|
|
||||||
|
session->transport->unbind_conn(conn, is_active);
|
||||||
|
session->transport->ep_disconnect(ep);
|
||||||
|
ISCSI_DBG_TRANS_CONN(conn, "disconnect ep done.\n");
|
||||||
|
}
|
||||||
|
|
||||||
static int iscsi_if_stop_conn(struct iscsi_transport *transport,
|
static int iscsi_if_stop_conn(struct iscsi_transport *transport,
|
||||||
struct iscsi_uevent *ev)
|
struct iscsi_uevent *ev)
|
||||||
{
|
{
|
||||||
@@ -2279,25 +2298,6 @@ static int iscsi_if_stop_conn(struct iscsi_transport *transport,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void iscsi_ep_disconnect(struct iscsi_cls_conn *conn, bool is_active)
|
|
||||||
{
|
|
||||||
struct iscsi_cls_session *session = iscsi_conn_to_session(conn);
|
|
||||||
struct iscsi_endpoint *ep;
|
|
||||||
|
|
||||||
ISCSI_DBG_TRANS_CONN(conn, "disconnect ep.\n");
|
|
||||||
conn->state = ISCSI_CONN_FAILED;
|
|
||||||
|
|
||||||
if (!conn->ep || !session->transport->ep_disconnect)
|
|
||||||
return;
|
|
||||||
|
|
||||||
ep = conn->ep;
|
|
||||||
conn->ep = NULL;
|
|
||||||
|
|
||||||
session->transport->unbind_conn(conn, is_active);
|
|
||||||
session->transport->ep_disconnect(ep);
|
|
||||||
ISCSI_DBG_TRANS_CONN(conn, "disconnect ep done.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
static void iscsi_cleanup_conn_work_fn(struct work_struct *work)
|
static void iscsi_cleanup_conn_work_fn(struct work_struct *work)
|
||||||
{
|
{
|
||||||
struct iscsi_cls_conn *conn = container_of(work, struct iscsi_cls_conn,
|
struct iscsi_cls_conn *conn = container_of(work, struct iscsi_cls_conn,
|
||||||
|
Reference in New Issue
Block a user