mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
scsi: libiscsi: Pass the session pointer directly to several functions
Pass the struct iscsi_session pointer directly to all functions that must be called with an iscsi_session synchronization object held. Update the callers of the modified functions in the iSER, be2iscsi, bnx2i, cxgbi, libiscsi, qedi and qla4xxx drivers. This patch prepares for enabling compile-time lock context analysis in libiscsi. No functionality has been changed. Cc: Lee Duncan <lduncan@suse.com> Cc: Chris Leech <cleech@redhat.com> Cc: Mike Christie <michael.christie@oracle.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://patch.msgid.link/f717adbc1d64a4ddb457d4878d704999922bf1d0.1790360262.git.bvanassche@acm.org Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
This commit is contained in:
parent
5a08252a78
commit
ae1c0d65bc
|
|
@ -604,7 +604,8 @@ static int iser_check_remote_inv(struct iser_conn *iser_conn, struct ib_wc *wc,
|
|||
return -EPROTO;
|
||||
}
|
||||
|
||||
task = iscsi_itt_to_ctask(iser_conn->iscsi_conn, hdr->itt);
|
||||
task = iscsi_itt_to_ctask(iser_conn->iscsi_conn->session,
|
||||
iser_conn->iscsi_conn, hdr->itt);
|
||||
if (likely(task)) {
|
||||
struct iscsi_iser_task *iser_task = task->dd_data;
|
||||
struct iser_fr_desc *desc;
|
||||
|
|
|
|||
|
|
@ -1178,7 +1178,7 @@ be_complete_io(struct beiscsi_conn *beiscsi_conn,
|
|||
scsi_dma_unmap(io_task->scsi_cmnd);
|
||||
io_task->scsi_cmnd = NULL;
|
||||
}
|
||||
iscsi_complete_scsi_task(task, exp_cmdsn, max_cmdsn);
|
||||
iscsi_complete_scsi_task(conn->session, task, exp_cmdsn, max_cmdsn);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1205,7 +1205,7 @@ be_complete_logout(struct beiscsi_conn *beiscsi_conn,
|
|||
hdr->dlength[2] = 0;
|
||||
hdr->hlength = 0;
|
||||
hdr->itt = io_task->libiscsi_itt;
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)hdr, NULL, 0);
|
||||
__iscsi_complete_pdu(conn->session, conn, (struct iscsi_hdr *)hdr, NULL, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1226,7 +1226,7 @@ be_complete_tmf(struct beiscsi_conn *beiscsi_conn,
|
|||
csol_cqe->cmd_wnd - 1);
|
||||
|
||||
hdr->itt = io_task->libiscsi_itt;
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)hdr, NULL, 0);
|
||||
__iscsi_complete_pdu(conn->session, conn, (struct iscsi_hdr *)hdr, NULL, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1260,7 +1260,7 @@ hwi_complete_drvr_msgs(struct beiscsi_conn *beiscsi_conn,
|
|||
spin_lock_bh(&session->back_lock);
|
||||
task = pwrb_handle->pio_handle;
|
||||
if (task)
|
||||
__iscsi_put_task(task);
|
||||
__iscsi_put_task(session, task);
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
}
|
||||
|
||||
|
|
@ -1281,7 +1281,7 @@ be_complete_nopin_resp(struct beiscsi_conn *beiscsi_conn,
|
|||
|
||||
hdr->opcode = ISCSI_OP_NOOP_IN;
|
||||
hdr->itt = io_task->libiscsi_itt;
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)hdr, NULL, 0);
|
||||
__iscsi_complete_pdu(conn->session, conn, (struct iscsi_hdr *)hdr, NULL, 0);
|
||||
}
|
||||
|
||||
static void adapter_get_sol_cqe(struct beiscsi_hba *phba,
|
||||
|
|
@ -1460,7 +1460,8 @@ beiscsi_complete_pdu(struct beiscsi_conn *beiscsi_conn,
|
|||
code);
|
||||
return 1;
|
||||
}
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)phdr, pdata, dlen);
|
||||
__iscsi_complete_pdu(conn->session, conn, (struct iscsi_hdr *)phdr, pdata,
|
||||
dlen);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -383,6 +383,7 @@ int bnx2i_send_iscsi_tmf(struct bnx2i_conn *bnx2i_conn,
|
|||
struct iscsi_task *mtask)
|
||||
{
|
||||
struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data;
|
||||
struct iscsi_session *session = conn->session;
|
||||
struct iscsi_tm *tmfabort_hdr;
|
||||
struct scsi_cmnd *ref_sc;
|
||||
struct iscsi_task *ctask;
|
||||
|
|
@ -404,7 +405,7 @@ int bnx2i_send_iscsi_tmf(struct bnx2i_conn *bnx2i_conn,
|
|||
switch (tmfabort_hdr->flags & ISCSI_FLAG_TM_FUNC_MASK) {
|
||||
case ISCSI_TM_FUNC_ABORT_TASK:
|
||||
case ISCSI_TM_FUNC_TASK_REASSIGN:
|
||||
ctask = iscsi_itt_to_task(conn, tmfabort_hdr->rtt);
|
||||
ctask = iscsi_itt_to_task(session, conn, tmfabort_hdr->rtt);
|
||||
if (!ctask || !ctask->sc)
|
||||
/*
|
||||
* the iscsi layer must have completed the cmd while
|
||||
|
|
@ -1347,7 +1348,7 @@ int bnx2i_process_scsi_cmd_resp(struct iscsi_session *session,
|
|||
|
||||
resp_cqe = (struct bnx2i_cmd_response *)cqe;
|
||||
spin_lock_bh(&session->back_lock);
|
||||
task = iscsi_itt_to_task(conn,
|
||||
task = iscsi_itt_to_task(session, conn,
|
||||
resp_cqe->itt & ISCSI_CMD_RESPONSE_INDEX);
|
||||
if (!task)
|
||||
goto fail;
|
||||
|
|
@ -1414,7 +1415,7 @@ int bnx2i_process_scsi_cmd_resp(struct iscsi_session *session,
|
|||
}
|
||||
|
||||
done:
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)hdr,
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)hdr,
|
||||
conn->data, datalen);
|
||||
fail:
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
|
|
@ -1443,7 +1444,7 @@ static int bnx2i_process_login_resp(struct iscsi_session *session,
|
|||
|
||||
login = (struct bnx2i_login_response *) cqe;
|
||||
spin_lock(&session->back_lock);
|
||||
task = iscsi_itt_to_task(conn,
|
||||
task = iscsi_itt_to_task(session, conn,
|
||||
login->itt & ISCSI_LOGIN_RESPONSE_INDEX);
|
||||
if (!task)
|
||||
goto done;
|
||||
|
|
@ -1481,7 +1482,7 @@ static int bnx2i_process_login_resp(struct iscsi_session *session,
|
|||
}
|
||||
}
|
||||
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)resp_hdr,
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)resp_hdr,
|
||||
bnx2i_conn->gen_pdu.resp_buf,
|
||||
bnx2i_conn->gen_pdu.resp_wr_ptr - bnx2i_conn->gen_pdu.resp_buf);
|
||||
done:
|
||||
|
|
@ -1511,7 +1512,8 @@ static int bnx2i_process_text_resp(struct iscsi_session *session,
|
|||
|
||||
text = (struct bnx2i_text_response *) cqe;
|
||||
spin_lock(&session->back_lock);
|
||||
task = iscsi_itt_to_task(conn, text->itt & ISCSI_LOGIN_RESPONSE_INDEX);
|
||||
task = iscsi_itt_to_task(session, conn,
|
||||
text->itt & ISCSI_LOGIN_RESPONSE_INDEX);
|
||||
if (!task)
|
||||
goto done;
|
||||
|
||||
|
|
@ -1541,7 +1543,7 @@ static int bnx2i_process_text_resp(struct iscsi_session *session,
|
|||
bnx2i_conn->gen_pdu.resp_wr_ptr++;
|
||||
}
|
||||
}
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)resp_hdr,
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)resp_hdr,
|
||||
bnx2i_conn->gen_pdu.resp_buf,
|
||||
bnx2i_conn->gen_pdu.resp_wr_ptr -
|
||||
bnx2i_conn->gen_pdu.resp_buf);
|
||||
|
|
@ -1570,7 +1572,7 @@ static int bnx2i_process_tmf_resp(struct iscsi_session *session,
|
|||
|
||||
tmf_cqe = (struct bnx2i_tmf_response *)cqe;
|
||||
spin_lock(&session->back_lock);
|
||||
task = iscsi_itt_to_task(conn,
|
||||
task = iscsi_itt_to_task(session, conn,
|
||||
tmf_cqe->itt & ISCSI_TMF_RESPONSE_INDEX);
|
||||
if (!task)
|
||||
goto done;
|
||||
|
|
@ -1583,7 +1585,7 @@ static int bnx2i_process_tmf_resp(struct iscsi_session *session,
|
|||
resp_hdr->itt = task->hdr->itt;
|
||||
resp_hdr->response = tmf_cqe->response;
|
||||
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)resp_hdr, NULL, 0);
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)resp_hdr, NULL, 0);
|
||||
done:
|
||||
spin_unlock(&session->back_lock);
|
||||
return 0;
|
||||
|
|
@ -1609,7 +1611,7 @@ static int bnx2i_process_logout_resp(struct iscsi_session *session,
|
|||
|
||||
logout = (struct bnx2i_logout_response *) cqe;
|
||||
spin_lock(&session->back_lock);
|
||||
task = iscsi_itt_to_task(conn,
|
||||
task = iscsi_itt_to_task(session, conn,
|
||||
logout->itt & ISCSI_LOGOUT_RESPONSE_INDEX);
|
||||
if (!task)
|
||||
goto done;
|
||||
|
|
@ -1628,7 +1630,7 @@ static int bnx2i_process_logout_resp(struct iscsi_session *session,
|
|||
resp_hdr->t2wait = cpu_to_be32(logout->time_to_wait);
|
||||
resp_hdr->t2retain = cpu_to_be32(logout->time_to_retain);
|
||||
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)resp_hdr, NULL, 0);
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)resp_hdr, NULL, 0);
|
||||
|
||||
bnx2i_conn->ep->state = EP_STATE_LOGOUT_RESP_RCVD;
|
||||
done:
|
||||
|
|
@ -1654,10 +1656,10 @@ static void bnx2i_process_nopin_local_cmpl(struct iscsi_session *session,
|
|||
|
||||
nop_in = (struct bnx2i_nop_in_msg *)cqe;
|
||||
spin_lock(&session->back_lock);
|
||||
task = iscsi_itt_to_task(conn,
|
||||
task = iscsi_itt_to_task(session, conn,
|
||||
nop_in->itt & ISCSI_NOP_IN_MSG_INDEX);
|
||||
if (task)
|
||||
__iscsi_put_task(task);
|
||||
__iscsi_put_task(session, task);
|
||||
spin_unlock(&session->back_lock);
|
||||
}
|
||||
|
||||
|
|
@ -1713,7 +1715,7 @@ static int bnx2i_process_nopin_mesg(struct iscsi_session *session,
|
|||
}
|
||||
|
||||
/* this is a response to one of our nop-outs */
|
||||
task = iscsi_itt_to_task(conn,
|
||||
task = iscsi_itt_to_task(session, conn,
|
||||
(itt_t) (nop_in->itt & ISCSI_NOP_IN_MSG_INDEX));
|
||||
if (task) {
|
||||
hdr->flags = ISCSI_FLAG_CMD_FINAL;
|
||||
|
|
@ -1722,7 +1724,7 @@ static int bnx2i_process_nopin_mesg(struct iscsi_session *session,
|
|||
memcpy(&hdr->lun, nop_in->lun, 8);
|
||||
}
|
||||
done:
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)hdr, NULL, 0);
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)hdr, NULL, 0);
|
||||
spin_unlock(&session->back_lock);
|
||||
|
||||
return tgt_async_nop;
|
||||
|
|
@ -1773,7 +1775,7 @@ static void bnx2i_process_async_mesg(struct iscsi_session *session,
|
|||
resp_hdr->param2 = cpu_to_be16(async_cqe->param2);
|
||||
resp_hdr->param3 = cpu_to_be16(async_cqe->param3);
|
||||
|
||||
__iscsi_complete_pdu(bnx2i_conn->cls_conn->dd_data,
|
||||
__iscsi_complete_pdu(session, bnx2i_conn->cls_conn->dd_data,
|
||||
(struct iscsi_hdr *)resp_hdr, NULL, 0);
|
||||
spin_unlock(&session->back_lock);
|
||||
}
|
||||
|
|
@ -1811,7 +1813,7 @@ static void bnx2i_process_reject_mesg(struct iscsi_session *session,
|
|||
hdr->max_cmdsn = cpu_to_be32(reject->max_cmd_sn);
|
||||
hdr->exp_cmdsn = cpu_to_be32(reject->exp_cmd_sn);
|
||||
hdr->ffffffff = cpu_to_be32(RESERVED_ITT);
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)hdr, conn->data,
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)hdr, conn->data,
|
||||
reject->data_length);
|
||||
spin_unlock(&session->back_lock);
|
||||
}
|
||||
|
|
@ -1834,7 +1836,7 @@ static void bnx2i_process_cmd_cleanup_resp(struct iscsi_session *session,
|
|||
|
||||
cmd_clean_rsp = (struct bnx2i_cleanup_response *)cqe;
|
||||
spin_lock(&session->back_lock);
|
||||
task = iscsi_itt_to_task(conn,
|
||||
task = iscsi_itt_to_task(session, conn,
|
||||
cmd_clean_rsp->itt & ISCSI_CLEANUP_RESPONSE_INDEX);
|
||||
if (!task)
|
||||
printk(KERN_ALERT "bnx2i: cmd clean ITT %x not active\n",
|
||||
|
|
@ -1908,7 +1910,7 @@ static int bnx2i_queue_scsi_cmd_resp(struct iscsi_session *session,
|
|||
int rc = 0;
|
||||
|
||||
spin_lock(&session->back_lock);
|
||||
task = iscsi_itt_to_task(bnx2i_conn->cls_conn->dd_data,
|
||||
task = iscsi_itt_to_task(session, bnx2i_conn->cls_conn->dd_data,
|
||||
cqe->itt & ISCSI_CMD_RESPONSE_INDEX);
|
||||
if (!task || !task->sc) {
|
||||
spin_unlock(&session->back_lock);
|
||||
|
|
|
|||
|
|
@ -1537,9 +1537,11 @@ skb_read_pdu_bhs(struct cxgbi_sock *csk, struct iscsi_conn *conn,
|
|||
* for the last pdu of a sequence.
|
||||
*/
|
||||
itt_t itt = ((struct iscsi_data *)skb->data)->itt;
|
||||
struct iscsi_task *task = iscsi_itt_to_ctask(conn, itt);
|
||||
u32 data_sn = be32_to_cpu(((struct iscsi_data *)
|
||||
skb->data)->datasn);
|
||||
struct iscsi_task *task;
|
||||
u32 data_sn;
|
||||
|
||||
task = iscsi_itt_to_ctask(conn->session, conn, itt);
|
||||
data_sn = be32_to_cpu(((struct iscsi_data *)skb->data)->datasn);
|
||||
if (task && task->sc) {
|
||||
struct iscsi_tcp_task *tcp_task = task->dd_data;
|
||||
|
||||
|
|
|
|||
|
|
@ -445,16 +445,17 @@ static int iscsi_prep_scsi_cmd_pdu(struct iscsi_task *task)
|
|||
|
||||
/**
|
||||
* iscsi_free_task - free a task
|
||||
* @session: iscsi session
|
||||
* @task: iscsi cmd task
|
||||
*
|
||||
* Must be called with session back_lock.
|
||||
* This function returns the scsi command to scsi-ml or cleans
|
||||
* up mgmt tasks then returns the task to the pool.
|
||||
*/
|
||||
static void iscsi_free_task(struct iscsi_task *task)
|
||||
static void iscsi_free_task(struct iscsi_session *session,
|
||||
struct iscsi_task *task)
|
||||
{
|
||||
struct iscsi_conn *conn = task->conn;
|
||||
struct iscsi_session *session = conn->session;
|
||||
struct scsi_cmnd *sc = task->sc;
|
||||
int oldstate = task->state;
|
||||
|
||||
|
|
@ -492,14 +493,15 @@ EXPORT_SYMBOL_GPL(iscsi_get_task);
|
|||
|
||||
/**
|
||||
* __iscsi_put_task - drop the refcount on a task
|
||||
* @session: iscsi session
|
||||
* @task: iscsi_task to drop the refcount on
|
||||
*
|
||||
* The back_lock must be held when calling in case it frees the task.
|
||||
*/
|
||||
void __iscsi_put_task(struct iscsi_task *task)
|
||||
void __iscsi_put_task(struct iscsi_session *session, struct iscsi_task *task)
|
||||
{
|
||||
if (refcount_dec_and_test(&task->refcount))
|
||||
iscsi_free_task(task);
|
||||
iscsi_free_task(session, task);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__iscsi_put_task);
|
||||
|
||||
|
|
@ -509,7 +511,7 @@ void iscsi_put_task(struct iscsi_task *task)
|
|||
|
||||
if (refcount_dec_and_test(&task->refcount)) {
|
||||
spin_lock_bh(&session->back_lock);
|
||||
iscsi_free_task(task);
|
||||
iscsi_free_task(session, task);
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
}
|
||||
}
|
||||
|
|
@ -517,17 +519,18 @@ EXPORT_SYMBOL_GPL(iscsi_put_task);
|
|||
|
||||
/**
|
||||
* iscsi_complete_task - finish a task
|
||||
* @session: iscsi session
|
||||
* @task: iscsi cmd task
|
||||
* @state: state to complete task with
|
||||
*
|
||||
* Must be called with session back_lock.
|
||||
*/
|
||||
static void iscsi_complete_task(struct iscsi_task *task, int state)
|
||||
static void iscsi_complete_task(struct iscsi_session *session,
|
||||
struct iscsi_task *task, int state)
|
||||
{
|
||||
struct iscsi_conn *conn = task->conn;
|
||||
|
||||
ISCSI_DBG_SESSION(conn->session,
|
||||
"complete task itt 0x%x state %d sc %p\n",
|
||||
ISCSI_DBG_SESSION(session, "complete task itt 0x%x state %d sc %p\n",
|
||||
task->itt, task->state, task->sc);
|
||||
if (task->state == ISCSI_TASK_COMPLETED ||
|
||||
task->state == ISCSI_TASK_ABRT_TMF ||
|
||||
|
|
@ -541,11 +544,12 @@ static void iscsi_complete_task(struct iscsi_task *task, int state)
|
|||
WRITE_ONCE(conn->ping_task, NULL);
|
||||
|
||||
/* release get from queueing */
|
||||
__iscsi_put_task(task);
|
||||
__iscsi_put_task(session, task);
|
||||
}
|
||||
|
||||
/**
|
||||
* iscsi_complete_scsi_task - finish scsi task normally
|
||||
* @session: iscsi session
|
||||
* @task: iscsi task for scsi cmd
|
||||
* @exp_cmdsn: expected cmd sn in cpu format
|
||||
* @max_cmdsn: max cmd sn in cpu format
|
||||
|
|
@ -555,23 +559,25 @@ static void iscsi_complete_task(struct iscsi_task *task, int state)
|
|||
*
|
||||
* Called with session back_lock
|
||||
*/
|
||||
void iscsi_complete_scsi_task(struct iscsi_task *task,
|
||||
void iscsi_complete_scsi_task(struct iscsi_session *session,
|
||||
struct iscsi_task *task,
|
||||
uint32_t exp_cmdsn, uint32_t max_cmdsn)
|
||||
{
|
||||
struct iscsi_conn *conn = task->conn;
|
||||
|
||||
ISCSI_DBG_SESSION(conn->session, "[itt 0x%x]\n", task->itt);
|
||||
ISCSI_DBG_SESSION(session, "[itt 0x%x]\n", task->itt);
|
||||
|
||||
conn->last_recv = jiffies;
|
||||
__iscsi_update_cmdsn(conn->session, exp_cmdsn, max_cmdsn);
|
||||
iscsi_complete_task(task, ISCSI_TASK_COMPLETED);
|
||||
__iscsi_update_cmdsn(session, exp_cmdsn, max_cmdsn);
|
||||
iscsi_complete_task(session, task, ISCSI_TASK_COMPLETED);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iscsi_complete_scsi_task);
|
||||
|
||||
/*
|
||||
* Must be called with back and frwd lock
|
||||
*/
|
||||
static bool cleanup_queued_task(struct iscsi_task *task)
|
||||
static bool cleanup_queued_task(struct iscsi_session *session,
|
||||
struct iscsi_task *task)
|
||||
{
|
||||
struct iscsi_conn *conn = task->conn;
|
||||
bool early_complete = false;
|
||||
|
|
@ -592,17 +598,17 @@ static bool cleanup_queued_task(struct iscsi_task *task)
|
|||
*/
|
||||
if (task->state == ISCSI_TASK_RUNNING ||
|
||||
task->state == ISCSI_TASK_COMPLETED)
|
||||
__iscsi_put_task(task);
|
||||
__iscsi_put_task(session, task);
|
||||
}
|
||||
|
||||
if (conn->session->running_aborted_task == task) {
|
||||
conn->session->running_aborted_task = NULL;
|
||||
__iscsi_put_task(task);
|
||||
if (session->running_aborted_task == task) {
|
||||
session->running_aborted_task = NULL;
|
||||
__iscsi_put_task(session, task);
|
||||
}
|
||||
|
||||
if (conn->task == task) {
|
||||
conn->task = NULL;
|
||||
__iscsi_put_task(task);
|
||||
__iscsi_put_task(session, task);
|
||||
}
|
||||
|
||||
return early_complete;
|
||||
|
|
@ -612,13 +618,13 @@ static bool cleanup_queued_task(struct iscsi_task *task)
|
|||
* session back and frwd lock must be held and if not called for a task that
|
||||
* is still pending or from the xmit thread, then xmit thread must be suspended
|
||||
*/
|
||||
static void __fail_scsi_task(struct iscsi_task *task, int err)
|
||||
static void __fail_scsi_task(struct iscsi_session *session,
|
||||
struct iscsi_task *task, int err)
|
||||
{
|
||||
struct iscsi_conn *conn = task->conn;
|
||||
struct scsi_cmnd *sc;
|
||||
int state;
|
||||
|
||||
if (cleanup_queued_task(task))
|
||||
if (cleanup_queued_task(session, task))
|
||||
return;
|
||||
|
||||
if (task->state == ISCSI_TASK_PENDING) {
|
||||
|
|
@ -626,7 +632,7 @@ static void __fail_scsi_task(struct iscsi_task *task, int err)
|
|||
* cmd never made it to the xmit thread, so we should not count
|
||||
* the cmd in the sequencing
|
||||
*/
|
||||
conn->session->queued_cmdsn--;
|
||||
session->queued_cmdsn--;
|
||||
/* it was never sent so just complete like normal */
|
||||
state = ISCSI_TASK_COMPLETED;
|
||||
} else if (err == DID_TRANSPORT_DISRUPTED)
|
||||
|
|
@ -637,15 +643,14 @@ static void __fail_scsi_task(struct iscsi_task *task, int err)
|
|||
sc = task->sc;
|
||||
sc->result = err << 16;
|
||||
scsi_set_resid(sc, scsi_bufflen(sc));
|
||||
iscsi_complete_task(task, state);
|
||||
iscsi_complete_task(session, task, state);
|
||||
}
|
||||
|
||||
static void fail_scsi_task(struct iscsi_task *task, int err)
|
||||
static void fail_scsi_task(struct iscsi_session *session,
|
||||
struct iscsi_task *task, int err)
|
||||
{
|
||||
struct iscsi_session *session = task->conn->session;
|
||||
|
||||
spin_lock_bh(&session->back_lock);
|
||||
__fail_scsi_task(task, err);
|
||||
__fail_scsi_task(session, task, err);
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
}
|
||||
|
||||
|
|
@ -857,6 +862,7 @@ EXPORT_SYMBOL_GPL(iscsi_conn_send_pdu);
|
|||
|
||||
/**
|
||||
* iscsi_scsi_cmd_rsp - SCSI Command Response processing
|
||||
* @session: iscsi session
|
||||
* @conn: iscsi connection
|
||||
* @hdr: iscsi header
|
||||
* @task: scsi command task
|
||||
|
|
@ -866,12 +872,12 @@ EXPORT_SYMBOL_GPL(iscsi_conn_send_pdu);
|
|||
* iscsi_cmd_rsp sets up the scsi_cmnd fields based on the PDU and
|
||||
* then completes the command and task. called under back_lock
|
||||
**/
|
||||
static void iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
||||
static void iscsi_scsi_cmd_rsp(struct iscsi_session *session,
|
||||
struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
||||
struct iscsi_task *task, char *data,
|
||||
int datalen)
|
||||
{
|
||||
struct iscsi_scsi_rsp *rhdr = (struct iscsi_scsi_rsp *)hdr;
|
||||
struct iscsi_session *session = conn->session;
|
||||
struct scsi_cmnd *sc = task->sc;
|
||||
|
||||
iscsi_update_cmdsn(session, (struct iscsi_nopin*)rhdr);
|
||||
|
|
@ -950,11 +956,12 @@ static void iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
|||
ISCSI_DBG_SESSION(session, "cmd rsp done [sc %p res %d itt 0x%x]\n",
|
||||
sc, sc->result, task->itt);
|
||||
conn->scsirsp_pdus_cnt++;
|
||||
iscsi_complete_task(task, ISCSI_TASK_COMPLETED);
|
||||
iscsi_complete_task(session, task, ISCSI_TASK_COMPLETED);
|
||||
}
|
||||
|
||||
/**
|
||||
* iscsi_data_in_rsp - SCSI Data-In Response processing
|
||||
* @session: iscsi session
|
||||
* @conn: iscsi connection
|
||||
* @hdr: iscsi pdu
|
||||
* @task: scsi command task
|
||||
|
|
@ -963,8 +970,8 @@ static void iscsi_scsi_cmd_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
|||
* then completes the command and task. called under back_lock
|
||||
**/
|
||||
static void
|
||||
iscsi_data_in_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
||||
struct iscsi_task *task)
|
||||
iscsi_data_in_rsp(struct iscsi_session *session, struct iscsi_conn *conn,
|
||||
struct iscsi_hdr *hdr, struct iscsi_task *task)
|
||||
{
|
||||
struct iscsi_data_rsp *rhdr = (struct iscsi_data_rsp *)hdr;
|
||||
struct scsi_cmnd *sc = task->sc;
|
||||
|
|
@ -972,7 +979,7 @@ iscsi_data_in_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
|||
if (!(rhdr->flags & ISCSI_FLAG_DATA_STATUS))
|
||||
return;
|
||||
|
||||
iscsi_update_cmdsn(conn->session, (struct iscsi_nopin *)hdr);
|
||||
iscsi_update_cmdsn(session, (struct iscsi_nopin *)hdr);
|
||||
sc->result = (DID_OK << 16) | rhdr->cmd_status;
|
||||
conn->exp_statsn = be32_to_cpu(rhdr->statsn) + 1;
|
||||
if (rhdr->flags & (ISCSI_FLAG_DATA_UNDERFLOW |
|
||||
|
|
@ -987,11 +994,11 @@ iscsi_data_in_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
|||
sc->result = (DID_BAD_TARGET << 16) | rhdr->cmd_status;
|
||||
}
|
||||
|
||||
ISCSI_DBG_SESSION(conn->session, "data in with status done "
|
||||
ISCSI_DBG_SESSION(session, "data in with status done "
|
||||
"[sc %p res %d itt 0x%x]\n",
|
||||
sc, sc->result, task->itt);
|
||||
conn->scsirsp_pdus_cnt++;
|
||||
iscsi_complete_task(task, ISCSI_TASK_COMPLETED);
|
||||
iscsi_complete_task(session, task, ISCSI_TASK_COMPLETED);
|
||||
}
|
||||
|
||||
static void iscsi_tmf_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr)
|
||||
|
|
@ -1059,6 +1066,7 @@ static int iscsi_send_nopout(struct iscsi_conn *conn, struct iscsi_nopin *rhdr)
|
|||
|
||||
/**
|
||||
* iscsi_nop_out_rsp - SCSI NOP Response processing
|
||||
* @session: iscsi session
|
||||
* @task: scsi command task
|
||||
* @nop: the nop structure
|
||||
* @data: where to put the data
|
||||
|
|
@ -1067,7 +1075,8 @@ static int iscsi_send_nopout(struct iscsi_conn *conn, struct iscsi_nopin *rhdr)
|
|||
* iscsi_nop_out_rsp handles nop response from use or
|
||||
* from user space. called under back_lock
|
||||
**/
|
||||
static int iscsi_nop_out_rsp(struct iscsi_task *task,
|
||||
static int iscsi_nop_out_rsp(struct iscsi_session *session,
|
||||
struct iscsi_task *task,
|
||||
struct iscsi_nopin *nop, char *data, int datalen)
|
||||
{
|
||||
struct iscsi_conn *conn = task->conn;
|
||||
|
|
@ -1083,11 +1092,12 @@ static int iscsi_nop_out_rsp(struct iscsi_task *task,
|
|||
rc = ISCSI_ERR_CONN_FAILED;
|
||||
} else
|
||||
mod_timer(&conn->transport_timer, jiffies + conn->recv_timeout);
|
||||
iscsi_complete_task(task, ISCSI_TASK_COMPLETED);
|
||||
iscsi_complete_task(session, task, ISCSI_TASK_COMPLETED);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int iscsi_handle_reject(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
||||
static int iscsi_handle_reject(struct iscsi_session *session,
|
||||
struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
||||
char *data, int datalen)
|
||||
{
|
||||
struct iscsi_reject *reject = (struct iscsi_reject *)hdr;
|
||||
|
|
@ -1136,26 +1146,27 @@ static int iscsi_handle_reject(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
|||
* Just resend.
|
||||
*/
|
||||
/* In RX path we are under back lock */
|
||||
spin_unlock(&conn->session->back_lock);
|
||||
spin_lock(&conn->session->frwd_lock);
|
||||
spin_unlock(&session->back_lock);
|
||||
spin_lock(&session->frwd_lock);
|
||||
iscsi_send_nopout(conn,
|
||||
(struct iscsi_nopin*)&rejected_pdu);
|
||||
spin_unlock(&conn->session->frwd_lock);
|
||||
spin_lock(&conn->session->back_lock);
|
||||
spin_unlock(&session->frwd_lock);
|
||||
spin_lock(&session->back_lock);
|
||||
} else {
|
||||
struct iscsi_task *task;
|
||||
/*
|
||||
* Our nop as ping got dropped. We know the target
|
||||
* and transport are ok so just clean up
|
||||
*/
|
||||
task = iscsi_itt_to_task(conn, rejected_pdu.itt);
|
||||
task = iscsi_itt_to_task(session, conn,
|
||||
rejected_pdu.itt);
|
||||
if (!task) {
|
||||
iscsi_conn_printk(KERN_ERR, conn,
|
||||
"Invalid pdu reject. Could "
|
||||
"not lookup rejected task.\n");
|
||||
rc = ISCSI_ERR_BAD_ITT;
|
||||
} else
|
||||
rc = iscsi_nop_out_rsp(task,
|
||||
rc = iscsi_nop_out_rsp(session, task,
|
||||
(struct iscsi_nopin*)&rejected_pdu,
|
||||
NULL, 0);
|
||||
}
|
||||
|
|
@ -1172,6 +1183,7 @@ static int iscsi_handle_reject(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
|||
|
||||
/**
|
||||
* iscsi_itt_to_task - look up task by itt
|
||||
* @session: iscsi session
|
||||
* @conn: iscsi connection
|
||||
* @itt: itt
|
||||
*
|
||||
|
|
@ -1180,9 +1192,9 @@ static int iscsi_handle_reject(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
|||
*
|
||||
* The session back_lock must be held.
|
||||
*/
|
||||
struct iscsi_task *iscsi_itt_to_task(struct iscsi_conn *conn, itt_t itt)
|
||||
struct iscsi_task *iscsi_itt_to_task(struct iscsi_session *session,
|
||||
struct iscsi_conn *conn, itt_t itt)
|
||||
{
|
||||
struct iscsi_session *session = conn->session;
|
||||
int i;
|
||||
|
||||
if (itt == RESERVED_ITT)
|
||||
|
|
@ -1201,6 +1213,7 @@ EXPORT_SYMBOL_GPL(iscsi_itt_to_task);
|
|||
|
||||
/**
|
||||
* __iscsi_complete_pdu - complete pdu
|
||||
* @session: iscsi session
|
||||
* @conn: iscsi conn
|
||||
* @hdr: iscsi header
|
||||
* @data: data buffer
|
||||
|
|
@ -1210,10 +1223,9 @@ EXPORT_SYMBOL_GPL(iscsi_itt_to_task);
|
|||
* queuecommand or send generic. session back_lock must be held and verify
|
||||
* itt must have been called.
|
||||
*/
|
||||
int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
||||
char *data, int datalen)
|
||||
int __iscsi_complete_pdu(struct iscsi_session *session, struct iscsi_conn *conn,
|
||||
struct iscsi_hdr *hdr, char *data, int datalen)
|
||||
{
|
||||
struct iscsi_session *session = conn->session;
|
||||
int opcode = hdr->opcode & ISCSI_OPCODE_MASK, rc = 0;
|
||||
struct iscsi_task *task;
|
||||
uint32_t itt;
|
||||
|
|
@ -1252,7 +1264,7 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
|||
spin_lock(&session->back_lock);
|
||||
break;
|
||||
case ISCSI_OP_REJECT:
|
||||
rc = iscsi_handle_reject(conn, hdr, data, datalen);
|
||||
rc = iscsi_handle_reject(session, conn, hdr, data, datalen);
|
||||
break;
|
||||
case ISCSI_OP_ASYNC_EVENT:
|
||||
conn->exp_statsn = be32_to_cpu(hdr->statsn) + 1;
|
||||
|
|
@ -1269,7 +1281,7 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
|||
switch(opcode) {
|
||||
case ISCSI_OP_SCSI_CMD_RSP:
|
||||
case ISCSI_OP_SCSI_DATA_IN:
|
||||
task = iscsi_itt_to_ctask(conn, hdr->itt);
|
||||
task = iscsi_itt_to_ctask(session, conn, hdr->itt);
|
||||
if (!task)
|
||||
return ISCSI_ERR_BAD_ITT;
|
||||
task->last_xfer = jiffies;
|
||||
|
|
@ -1284,7 +1296,7 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
|||
case ISCSI_OP_TEXT_RSP:
|
||||
case ISCSI_OP_SCSI_TMFUNC_RSP:
|
||||
case ISCSI_OP_NOOP_IN:
|
||||
task = iscsi_itt_to_task(conn, hdr->itt);
|
||||
task = iscsi_itt_to_task(session, conn, hdr->itt);
|
||||
if (!task)
|
||||
return ISCSI_ERR_BAD_ITT;
|
||||
break;
|
||||
|
|
@ -1294,10 +1306,10 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
|||
|
||||
switch(opcode) {
|
||||
case ISCSI_OP_SCSI_CMD_RSP:
|
||||
iscsi_scsi_cmd_rsp(conn, hdr, task, data, datalen);
|
||||
iscsi_scsi_cmd_rsp(session, conn, hdr, task, data, datalen);
|
||||
break;
|
||||
case ISCSI_OP_SCSI_DATA_IN:
|
||||
iscsi_data_in_rsp(conn, hdr, task);
|
||||
iscsi_data_in_rsp(session, conn, hdr, task);
|
||||
break;
|
||||
case ISCSI_OP_LOGOUT_RSP:
|
||||
iscsi_update_cmdsn(session, (struct iscsi_nopin*)hdr);
|
||||
|
|
@ -1323,7 +1335,7 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
|||
}
|
||||
|
||||
iscsi_tmf_rsp(conn, hdr);
|
||||
iscsi_complete_task(task, ISCSI_TASK_COMPLETED);
|
||||
iscsi_complete_task(session, task, ISCSI_TASK_COMPLETED);
|
||||
break;
|
||||
case ISCSI_OP_NOOP_IN:
|
||||
iscsi_update_cmdsn(session, (struct iscsi_nopin*)hdr);
|
||||
|
|
@ -1333,7 +1345,7 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
|||
}
|
||||
conn->exp_statsn = be32_to_cpu(hdr->statsn) + 1;
|
||||
|
||||
rc = iscsi_nop_out_rsp(task, (struct iscsi_nopin*)hdr,
|
||||
rc = iscsi_nop_out_rsp(session, task, (struct iscsi_nopin*)hdr,
|
||||
data, datalen);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -1346,7 +1358,7 @@ int __iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
|||
recv_pdu:
|
||||
if (iscsi_recv_pdu(conn->cls_conn, hdr, data, datalen))
|
||||
rc = ISCSI_ERR_CONN_FAILED;
|
||||
iscsi_complete_task(task, ISCSI_TASK_COMPLETED);
|
||||
iscsi_complete_task(session, task, ISCSI_TASK_COMPLETED);
|
||||
return rc;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(__iscsi_complete_pdu);
|
||||
|
|
@ -1354,11 +1366,12 @@ EXPORT_SYMBOL_GPL(__iscsi_complete_pdu);
|
|||
int iscsi_complete_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
|
||||
char *data, int datalen)
|
||||
{
|
||||
struct iscsi_session *session = conn->session;
|
||||
int rc;
|
||||
|
||||
spin_lock(&conn->session->back_lock);
|
||||
rc = __iscsi_complete_pdu(conn, hdr, data, datalen);
|
||||
spin_unlock(&conn->session->back_lock);
|
||||
spin_lock(&session->back_lock);
|
||||
rc = __iscsi_complete_pdu(session, conn, hdr, data, datalen);
|
||||
spin_unlock(&session->back_lock);
|
||||
return rc;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iscsi_complete_pdu);
|
||||
|
|
@ -1397,6 +1410,7 @@ EXPORT_SYMBOL_GPL(iscsi_verify_itt);
|
|||
|
||||
/**
|
||||
* iscsi_itt_to_ctask - look up ctask by itt
|
||||
* @session: iscsi session
|
||||
* @conn: iscsi connection
|
||||
* @itt: itt
|
||||
*
|
||||
|
|
@ -1404,21 +1418,22 @@ EXPORT_SYMBOL_GPL(iscsi_verify_itt);
|
|||
*
|
||||
* The session back_lock must be held.
|
||||
*/
|
||||
struct iscsi_task *iscsi_itt_to_ctask(struct iscsi_conn *conn, itt_t itt)
|
||||
struct iscsi_task *iscsi_itt_to_ctask(struct iscsi_session *session,
|
||||
struct iscsi_conn *conn, itt_t itt)
|
||||
{
|
||||
struct iscsi_task *task;
|
||||
|
||||
if (iscsi_verify_itt(conn, itt))
|
||||
return NULL;
|
||||
|
||||
task = iscsi_itt_to_task(conn, itt);
|
||||
task = iscsi_itt_to_task(session, conn, itt);
|
||||
if (!task || !task->sc)
|
||||
return NULL;
|
||||
|
||||
if (iscsi_cmd(task->sc)->age != conn->session->age) {
|
||||
iscsi_session_printk(KERN_ERR, conn->session,
|
||||
if (iscsi_cmd(task->sc)->age != session->age) {
|
||||
iscsi_session_printk(KERN_ERR, session,
|
||||
"task's session age %d, expected %d\n",
|
||||
iscsi_cmd(task->sc)->age, conn->session->age);
|
||||
iscsi_cmd(task->sc)->age, session->age);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -1482,10 +1497,9 @@ void iscsi_conn_failure(struct iscsi_conn *conn, enum iscsi_err err)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(iscsi_conn_failure);
|
||||
|
||||
static int iscsi_check_cmdsn_window_closed(struct iscsi_conn *conn)
|
||||
static int iscsi_check_cmdsn_window_closed(struct iscsi_session *session,
|
||||
struct iscsi_conn *conn)
|
||||
{
|
||||
struct iscsi_session *session = conn->session;
|
||||
|
||||
/*
|
||||
* Check for iSCSI window and take care of CmdSN wrap-around
|
||||
*/
|
||||
|
|
@ -1499,8 +1513,8 @@ static int iscsi_check_cmdsn_window_closed(struct iscsi_conn *conn)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int iscsi_xmit_task(struct iscsi_conn *conn, struct iscsi_task *task,
|
||||
bool was_requeue)
|
||||
static int iscsi_xmit_task(struct iscsi_session *session, struct iscsi_conn *conn,
|
||||
struct iscsi_task *task, bool was_requeue)
|
||||
{
|
||||
int rc;
|
||||
|
||||
|
|
@ -1540,9 +1554,9 @@ static int iscsi_xmit_task(struct iscsi_conn *conn, struct iscsi_task *task,
|
|||
return -ENODATA;
|
||||
}
|
||||
|
||||
spin_unlock_bh(&conn->session->frwd_lock);
|
||||
rc = conn->session->tt->xmit_task(task);
|
||||
spin_lock_bh(&conn->session->frwd_lock);
|
||||
spin_unlock_bh(&session->frwd_lock);
|
||||
rc = session->tt->xmit_task(task);
|
||||
spin_lock_bh(&session->frwd_lock);
|
||||
if (!rc) {
|
||||
/* done with this task */
|
||||
task->last_xfer = jiffies;
|
||||
|
|
@ -1599,18 +1613,19 @@ EXPORT_SYMBOL_GPL(iscsi_requeue_task);
|
|||
**/
|
||||
static int iscsi_data_xmit(struct iscsi_conn *conn)
|
||||
{
|
||||
struct iscsi_session *session = conn->session;
|
||||
struct iscsi_task *task;
|
||||
int rc = 0;
|
||||
|
||||
spin_lock_bh(&conn->session->frwd_lock);
|
||||
spin_lock_bh(&session->frwd_lock);
|
||||
if (test_bit(ISCSI_CONN_FLAG_SUSPEND_TX, &conn->flags)) {
|
||||
ISCSI_DBG_SESSION(conn->session, "Tx suspended!\n");
|
||||
spin_unlock_bh(&conn->session->frwd_lock);
|
||||
ISCSI_DBG_SESSION(session, "Tx suspended!\n");
|
||||
spin_unlock_bh(&session->frwd_lock);
|
||||
return -ENODATA;
|
||||
}
|
||||
|
||||
if (conn->task) {
|
||||
rc = iscsi_xmit_task(conn, conn->task, false);
|
||||
rc = iscsi_xmit_task(session, conn, conn->task, false);
|
||||
if (rc)
|
||||
goto done;
|
||||
}
|
||||
|
|
@ -1627,12 +1642,12 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
|
|||
list_del_init(&task->running);
|
||||
if (iscsi_prep_mgmt_task(conn, task)) {
|
||||
/* regular RX path uses back_lock */
|
||||
spin_lock_bh(&conn->session->back_lock);
|
||||
__iscsi_put_task(task);
|
||||
spin_unlock_bh(&conn->session->back_lock);
|
||||
spin_lock_bh(&session->back_lock);
|
||||
__iscsi_put_task(session, task);
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
continue;
|
||||
}
|
||||
rc = iscsi_xmit_task(conn, task, false);
|
||||
rc = iscsi_xmit_task(session, conn, task, false);
|
||||
if (rc)
|
||||
goto done;
|
||||
}
|
||||
|
|
@ -1642,7 +1657,7 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
|
|||
/*
|
||||
* we always do fastlogout - conn stop code will clean up.
|
||||
*/
|
||||
if (conn->session->state == ISCSI_STATE_LOGGING_OUT)
|
||||
if (session->state == ISCSI_STATE_LOGGING_OUT)
|
||||
break;
|
||||
|
||||
task = list_entry(conn->requeue.next, struct iscsi_task,
|
||||
|
|
@ -1652,7 +1667,7 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
|
|||
break;
|
||||
|
||||
list_del_init(&task->running);
|
||||
rc = iscsi_xmit_task(conn, task, true);
|
||||
rc = iscsi_xmit_task(session, conn, task, true);
|
||||
if (rc)
|
||||
goto done;
|
||||
if (!list_empty(&conn->mgmtqueue))
|
||||
|
|
@ -1664,19 +1679,19 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
|
|||
task = list_entry(conn->cmdqueue.next, struct iscsi_task,
|
||||
running);
|
||||
list_del_init(&task->running);
|
||||
if (conn->session->state == ISCSI_STATE_LOGGING_OUT) {
|
||||
fail_scsi_task(task, DID_IMM_RETRY);
|
||||
if (session->state == ISCSI_STATE_LOGGING_OUT) {
|
||||
fail_scsi_task(session, task, DID_IMM_RETRY);
|
||||
continue;
|
||||
}
|
||||
rc = iscsi_prep_scsi_cmd_pdu(task);
|
||||
if (rc) {
|
||||
if (rc == -ENOMEM || rc == -EACCES)
|
||||
fail_scsi_task(task, DID_IMM_RETRY);
|
||||
fail_scsi_task(session, task, DID_IMM_RETRY);
|
||||
else
|
||||
fail_scsi_task(task, DID_ABORT);
|
||||
fail_scsi_task(session, task, DID_ABORT);
|
||||
continue;
|
||||
}
|
||||
rc = iscsi_xmit_task(conn, task, false);
|
||||
rc = iscsi_xmit_task(session, conn, task, false);
|
||||
if (rc)
|
||||
goto done;
|
||||
/*
|
||||
|
|
@ -1690,11 +1705,11 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
|
|||
goto check_requeue;
|
||||
}
|
||||
|
||||
spin_unlock_bh(&conn->session->frwd_lock);
|
||||
spin_unlock_bh(&session->frwd_lock);
|
||||
return -ENODATA;
|
||||
|
||||
done:
|
||||
spin_unlock_bh(&conn->session->frwd_lock);
|
||||
spin_unlock_bh(&session->frwd_lock);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
@ -1828,7 +1843,7 @@ enum scsi_qc_status iscsi_queuecommand(struct Scsi_Host *host,
|
|||
goto fault;
|
||||
}
|
||||
|
||||
if (iscsi_check_cmdsn_window_closed(conn)) {
|
||||
if (iscsi_check_cmdsn_window_closed(session, conn)) {
|
||||
reason = FAILURE_WINDOW_CLOSED;
|
||||
goto reject;
|
||||
}
|
||||
|
|
@ -1866,7 +1881,7 @@ enum scsi_qc_status iscsi_queuecommand(struct Scsi_Host *host,
|
|||
|
||||
prepd_reject:
|
||||
spin_lock_bh(&session->back_lock);
|
||||
iscsi_complete_task(task, ISCSI_TASK_REQUEUE_SCSIQ);
|
||||
iscsi_complete_task(session, task, ISCSI_TASK_REQUEUE_SCSIQ);
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
reject:
|
||||
spin_unlock_bh(&session->frwd_lock);
|
||||
|
|
@ -1876,7 +1891,7 @@ enum scsi_qc_status iscsi_queuecommand(struct Scsi_Host *host,
|
|||
|
||||
prepd_fault:
|
||||
spin_lock_bh(&session->back_lock);
|
||||
iscsi_complete_task(task, ISCSI_TASK_REQUEUE_SCSIQ);
|
||||
iscsi_complete_task(session, task, ISCSI_TASK_REQUEUE_SCSIQ);
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
fault:
|
||||
spin_unlock_bh(&session->frwd_lock);
|
||||
|
|
@ -1913,13 +1928,12 @@ static void iscsi_tmf_timedout(struct timer_list *t)
|
|||
spin_unlock(&session->frwd_lock);
|
||||
}
|
||||
|
||||
static int iscsi_exec_task_mgmt_fn(struct iscsi_conn *conn,
|
||||
static int iscsi_exec_task_mgmt_fn(struct iscsi_session *session,
|
||||
struct iscsi_conn *conn,
|
||||
struct iscsi_tm *hdr, int age,
|
||||
int timeout)
|
||||
__must_hold(&session->frwd_lock)
|
||||
{
|
||||
struct iscsi_session *session = conn->session;
|
||||
|
||||
if (__iscsi_conn_send_pdu(conn, (struct iscsi_hdr *)hdr, NULL, 0)) {
|
||||
spin_unlock_bh(&session->frwd_lock);
|
||||
iscsi_conn_printk(KERN_ERR, conn, "Could not send TMF.\n");
|
||||
|
|
@ -1962,9 +1976,9 @@ static int iscsi_exec_task_mgmt_fn(struct iscsi_conn *conn,
|
|||
/*
|
||||
* Fail commands. session frwd lock held and xmit thread flushed.
|
||||
*/
|
||||
static void fail_scsi_tasks(struct iscsi_conn *conn, u64 lun, int error)
|
||||
static void fail_scsi_tasks(struct iscsi_session *session, struct iscsi_conn *conn,
|
||||
u64 lun, int error)
|
||||
{
|
||||
struct iscsi_session *session = conn->session;
|
||||
struct iscsi_task *task;
|
||||
int i;
|
||||
|
||||
|
|
@ -1993,8 +2007,8 @@ static void fail_scsi_tasks(struct iscsi_conn *conn, u64 lun, int error)
|
|||
ISCSI_DBG_SESSION(session,
|
||||
"failing sc %p itt 0x%x state %d\n",
|
||||
task->sc, task->itt, task->state);
|
||||
__fail_scsi_task(task, error);
|
||||
__iscsi_put_task(task);
|
||||
__fail_scsi_task(session, task, error);
|
||||
__iscsi_put_task(session, task);
|
||||
}
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
}
|
||||
|
|
@ -2415,7 +2429,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
|
|||
spin_unlock(&session->back_lock);
|
||||
|
||||
if (task->state == ISCSI_TASK_PENDING) {
|
||||
fail_scsi_task(task, DID_ABORT);
|
||||
fail_scsi_task(session, task, DID_ABORT);
|
||||
goto success;
|
||||
}
|
||||
|
||||
|
|
@ -2427,7 +2441,8 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
|
|||
hdr = &session->tmhdr;
|
||||
iscsi_prep_abort_task_pdu(task, hdr);
|
||||
|
||||
if (iscsi_exec_task_mgmt_fn(conn, hdr, age, session->abort_timeout))
|
||||
if (iscsi_exec_task_mgmt_fn(session, conn, hdr, age,
|
||||
session->abort_timeout))
|
||||
goto failed;
|
||||
|
||||
switch (session->tmf_state) {
|
||||
|
|
@ -2444,7 +2459,7 @@ int iscsi_eh_abort(struct scsi_cmnd *sc)
|
|||
* then sent more data for the cmd.
|
||||
*/
|
||||
spin_lock_bh(&session->frwd_lock);
|
||||
fail_scsi_task(task, DID_ABORT);
|
||||
fail_scsi_task(session, task, DID_ABORT);
|
||||
session->tmf_state = TMF_INITIAL;
|
||||
memset(hdr, 0, sizeof(*hdr));
|
||||
spin_unlock_bh(&session->frwd_lock);
|
||||
|
|
@ -2541,7 +2556,7 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc)
|
|||
hdr = &session->tmhdr;
|
||||
iscsi_prep_lun_reset_pdu(sc, hdr);
|
||||
|
||||
if (iscsi_exec_task_mgmt_fn(conn, hdr, session->age,
|
||||
if (iscsi_exec_task_mgmt_fn(session, conn, hdr, session->age,
|
||||
session->lu_reset_timeout)) {
|
||||
rc = FAILED;
|
||||
goto unlock;
|
||||
|
|
@ -2566,7 +2581,7 @@ int iscsi_eh_device_reset(struct scsi_cmnd *sc)
|
|||
|
||||
spin_lock_bh(&session->frwd_lock);
|
||||
memset(hdr, 0, sizeof(*hdr));
|
||||
fail_scsi_tasks(conn, sc->device->lun, DID_ERROR);
|
||||
fail_scsi_tasks(session, conn, sc->device->lun, DID_ERROR);
|
||||
session->tmf_state = TMF_INITIAL;
|
||||
spin_unlock_bh(&session->frwd_lock);
|
||||
|
||||
|
|
@ -2703,7 +2718,7 @@ static int iscsi_eh_target_reset(struct scsi_cmnd *sc)
|
|||
hdr = &session->tmhdr;
|
||||
iscsi_prep_tgt_reset_pdu(sc, hdr);
|
||||
|
||||
if (iscsi_exec_task_mgmt_fn(conn, hdr, session->age,
|
||||
if (iscsi_exec_task_mgmt_fn(session, conn, hdr, session->age,
|
||||
session->tgt_reset_timeout)) {
|
||||
rc = FAILED;
|
||||
goto unlock;
|
||||
|
|
@ -2728,7 +2743,7 @@ static int iscsi_eh_target_reset(struct scsi_cmnd *sc)
|
|||
|
||||
spin_lock_bh(&session->frwd_lock);
|
||||
memset(hdr, 0, sizeof(*hdr));
|
||||
fail_scsi_tasks(conn, -1, DID_ERROR);
|
||||
fail_scsi_tasks(session, conn, -1, DID_ERROR);
|
||||
session->tmf_state = TMF_INITIAL;
|
||||
spin_unlock_bh(&session->frwd_lock);
|
||||
|
||||
|
|
@ -3374,7 +3389,7 @@ fail_mgmt_tasks(struct iscsi_session *session, struct iscsi_conn *conn)
|
|||
task->itt, task->state);
|
||||
|
||||
spin_lock_bh(&session->back_lock);
|
||||
if (cleanup_queued_task(task)) {
|
||||
if (cleanup_queued_task(session, task)) {
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
continue;
|
||||
}
|
||||
|
|
@ -3382,7 +3397,7 @@ fail_mgmt_tasks(struct iscsi_session *session, struct iscsi_conn *conn)
|
|||
state = ISCSI_TASK_ABRT_SESS_RECOV;
|
||||
if (task->state == ISCSI_TASK_PENDING)
|
||||
state = ISCSI_TASK_COMPLETED;
|
||||
iscsi_complete_task(task, state);
|
||||
iscsi_complete_task(session, task, state);
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
}
|
||||
}
|
||||
|
|
@ -3442,7 +3457,7 @@ void iscsi_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
|
|||
* flush queues.
|
||||
*/
|
||||
spin_lock_bh(&session->frwd_lock);
|
||||
fail_scsi_tasks(conn, -1, DID_TRANSPORT_DISRUPTED);
|
||||
fail_scsi_tasks(session, conn, -1, DID_TRANSPORT_DISRUPTED);
|
||||
fail_mgmt_tasks(session, conn);
|
||||
memset(&session->tmhdr, 0, sizeof(session->tmhdr));
|
||||
spin_unlock_bh(&session->frwd_lock);
|
||||
|
|
|
|||
|
|
@ -529,7 +529,7 @@ static int iscsi_tcp_r2t_rsp(struct iscsi_conn *conn, struct iscsi_hdr *hdr)
|
|||
int rc;
|
||||
|
||||
spin_lock(&session->back_lock);
|
||||
task = iscsi_itt_to_ctask(conn, hdr->itt);
|
||||
task = iscsi_itt_to_ctask(session, conn, hdr->itt);
|
||||
if (!task) {
|
||||
spin_unlock(&session->back_lock);
|
||||
return ISCSI_ERR_BAD_ITT;
|
||||
|
|
@ -677,6 +677,7 @@ iscsi_tcp_process_data_in(struct iscsi_tcp_conn *tcp_conn,
|
|||
static int
|
||||
iscsi_tcp_hdr_dissect(struct iscsi_conn *conn, struct iscsi_hdr *hdr)
|
||||
{
|
||||
struct iscsi_session *session = conn->session;
|
||||
int rc = 0, opcode, ahslen;
|
||||
struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
|
||||
struct iscsi_task *task;
|
||||
|
|
@ -706,14 +707,14 @@ iscsi_tcp_hdr_dissect(struct iscsi_conn *conn, struct iscsi_hdr *hdr)
|
|||
|
||||
switch(opcode) {
|
||||
case ISCSI_OP_SCSI_DATA_IN:
|
||||
spin_lock(&conn->session->back_lock);
|
||||
task = iscsi_itt_to_ctask(conn, hdr->itt);
|
||||
spin_lock(&session->back_lock);
|
||||
task = iscsi_itt_to_ctask(session, conn, hdr->itt);
|
||||
if (!task)
|
||||
rc = ISCSI_ERR_BAD_ITT;
|
||||
else
|
||||
rc = iscsi_tcp_data_in(conn, task);
|
||||
if (rc) {
|
||||
spin_unlock(&conn->session->back_lock);
|
||||
spin_unlock(&session->back_lock);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -731,7 +732,7 @@ iscsi_tcp_hdr_dissect(struct iscsi_conn *conn, struct iscsi_hdr *hdr)
|
|||
* update the digest per-entry.
|
||||
*/
|
||||
if (conn->datadgst_en &&
|
||||
!(conn->session->tt->caps & CAP_DIGEST_OFFLOAD))
|
||||
!(session->tt->caps & CAP_DIGEST_OFFLOAD))
|
||||
rx_crcp = tcp_conn->rx_crcp;
|
||||
|
||||
ISCSI_DBG_TCP(conn, "iscsi_tcp_begin_data_in( "
|
||||
|
|
@ -746,11 +747,11 @@ iscsi_tcp_hdr_dissect(struct iscsi_conn *conn, struct iscsi_hdr *hdr)
|
|||
tcp_conn->in.datalen,
|
||||
iscsi_tcp_process_data_in,
|
||||
rx_crcp);
|
||||
spin_unlock(&conn->session->back_lock);
|
||||
spin_unlock(&session->back_lock);
|
||||
return rc;
|
||||
}
|
||||
rc = __iscsi_complete_pdu(conn, hdr, NULL, 0);
|
||||
spin_unlock(&conn->session->back_lock);
|
||||
rc = __iscsi_complete_pdu(session, conn, hdr, NULL, 0);
|
||||
spin_unlock(&session->back_lock);
|
||||
break;
|
||||
case ISCSI_OP_R2T:
|
||||
if (ahslen) {
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ static void qedi_process_logout_resp(struct qedi_ctx *qedi,
|
|||
spin_unlock(&qedi_conn->list_lock);
|
||||
|
||||
cmd->state = RESPONSE_RECEIVED;
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)resp_hdr, NULL, 0);
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)resp_hdr, NULL, 0);
|
||||
|
||||
spin_unlock(&session->back_lock);
|
||||
}
|
||||
|
|
@ -138,7 +138,7 @@ static void qedi_process_text_resp(struct qedi_ctx *qedi,
|
|||
|
||||
cmd->state = RESPONSE_RECEIVED;
|
||||
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)resp_hdr_ptr,
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)resp_hdr_ptr,
|
||||
qedi_conn->gen_pdu.resp_buf,
|
||||
(qedi_conn->gen_pdu.resp_wr_ptr -
|
||||
qedi_conn->gen_pdu.resp_buf));
|
||||
|
|
@ -163,7 +163,8 @@ static void qedi_tmf_resp_work(struct work_struct *work)
|
|||
goto exit_tmf_resp;
|
||||
|
||||
spin_lock(&session->back_lock);
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)resp_hdr_ptr, NULL, 0);
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)resp_hdr_ptr, NULL,
|
||||
0);
|
||||
spin_unlock(&session->back_lock);
|
||||
|
||||
exit_tmf_resp:
|
||||
|
|
@ -247,7 +248,8 @@ static void qedi_process_tmf_resp(struct qedi_ctx *qedi,
|
|||
}
|
||||
spin_unlock(&qedi_conn->tmf_work_lock);
|
||||
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)resp_hdr_ptr, NULL, 0);
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)resp_hdr_ptr, NULL,
|
||||
0);
|
||||
kfree(resp_hdr_ptr);
|
||||
|
||||
unblock_sess:
|
||||
|
|
@ -304,7 +306,7 @@ static void qedi_process_login_resp(struct qedi_ctx *qedi,
|
|||
|
||||
memset(task_ctx, '\0', sizeof(*task_ctx));
|
||||
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)resp_hdr_ptr,
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)resp_hdr_ptr,
|
||||
qedi_conn->gen_pdu.resp_buf,
|
||||
(qedi_conn->gen_pdu.resp_wr_ptr -
|
||||
qedi_conn->gen_pdu.resp_buf));
|
||||
|
|
@ -470,7 +472,8 @@ static int qedi_process_nopin_mesg(struct qedi_ctx *qedi,
|
|||
}
|
||||
|
||||
done:
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)hdr, bdq_data, pdu_len);
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)hdr, bdq_data,
|
||||
pdu_len);
|
||||
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
return tgt_async_nop;
|
||||
|
|
@ -524,7 +527,7 @@ static void qedi_process_async_mesg(struct qedi_ctx *qedi,
|
|||
resp_hdr->param2 = cpu_to_be16(cqe_async_msg->param2_rsrv);
|
||||
resp_hdr->param3 = cpu_to_be16(cqe_async_msg->param3_rsrv);
|
||||
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)resp_hdr, bdq_data,
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)resp_hdr, bdq_data,
|
||||
pdu_len);
|
||||
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
|
|
@ -567,7 +570,7 @@ static void qedi_process_reject_mesg(struct qedi_ctx *qedi,
|
|||
hdr->statsn = cpu_to_be32(cqe_reject->stat_sn);
|
||||
hdr->ffffffff = cpu_to_be32(0xffffffff);
|
||||
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)hdr,
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)hdr,
|
||||
conn->data, pld_len);
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
}
|
||||
|
|
@ -664,7 +667,7 @@ static void qedi_scsi_completion(struct qedi_ctx *qedi,
|
|||
if (qedi_io_tracing)
|
||||
qedi_trace_io(qedi, task, cmd->task_id, QEDI_IO_TRACE_RSP);
|
||||
|
||||
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)hdr,
|
||||
__iscsi_complete_pdu(session, conn, (struct iscsi_hdr *)hdr,
|
||||
conn->data, datalen);
|
||||
error:
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
|
|
@ -722,7 +725,7 @@ static void qedi_process_nopin_local_cmpl(struct qedi_ctx *qedi,
|
|||
cmd->state = RESPONSE_RECEIVED;
|
||||
|
||||
spin_lock_bh(&session->back_lock);
|
||||
__iscsi_put_task(task);
|
||||
__iscsi_put_task(session, task);
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
}
|
||||
|
||||
|
|
@ -1316,6 +1319,7 @@ static void qedi_abort_work(struct work_struct *work)
|
|||
struct qedi_conn *qedi_conn = qedi_cmd->conn;
|
||||
struct qedi_ctx *qedi = qedi_conn->qedi;
|
||||
struct iscsi_conn *conn = qedi_conn->cls_conn->dd_data;
|
||||
struct iscsi_session *session = conn->session;
|
||||
struct qedi_work_map *list_work = NULL;
|
||||
struct iscsi_task *mtask;
|
||||
struct qedi_cmd *cmd;
|
||||
|
|
@ -1326,16 +1330,16 @@ static void qedi_abort_work(struct work_struct *work)
|
|||
mtask = qedi_cmd->task;
|
||||
tmf_hdr = (struct iscsi_tm *)mtask->hdr;
|
||||
|
||||
spin_lock_bh(&conn->session->back_lock);
|
||||
ctask = iscsi_itt_to_ctask(conn, tmf_hdr->rtt);
|
||||
spin_lock_bh(&session->back_lock);
|
||||
ctask = iscsi_itt_to_ctask(session, conn, tmf_hdr->rtt);
|
||||
if (!ctask) {
|
||||
spin_unlock_bh(&conn->session->back_lock);
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
QEDI_ERR(&qedi->dbg_ctx, "Invalid RTT. Letting abort timeout.\n");
|
||||
goto clear_cleanup;
|
||||
}
|
||||
|
||||
if (iscsi_task_is_completed(ctask)) {
|
||||
spin_unlock_bh(&conn->session->back_lock);
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO,
|
||||
"Task already completed\n");
|
||||
/*
|
||||
|
|
@ -1344,7 +1348,7 @@ static void qedi_abort_work(struct work_struct *work)
|
|||
*/
|
||||
goto send_tmf;
|
||||
}
|
||||
spin_unlock_bh(&conn->session->back_lock);
|
||||
spin_unlock_bh(&session->back_lock);
|
||||
|
||||
cmd = (struct qedi_cmd *)ctask->dd_data;
|
||||
QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO,
|
||||
|
|
|
|||
|
|
@ -367,6 +367,7 @@ static void qla4xxx_passthru_status_entry(struct scsi_qla_host *ha,
|
|||
struct ddb_entry *ddb_entry;
|
||||
struct ql4_task_data *task_data;
|
||||
struct iscsi_cls_conn *cls_conn;
|
||||
struct iscsi_session *session;
|
||||
struct iscsi_conn *conn;
|
||||
itt_t itt;
|
||||
uint32_t fw_ddb_index;
|
||||
|
|
@ -384,9 +385,10 @@ static void qla4xxx_passthru_status_entry(struct scsi_qla_host *ha,
|
|||
|
||||
cls_conn = ddb_entry->conn;
|
||||
conn = cls_conn->dd_data;
|
||||
spin_lock(&conn->session->back_lock);
|
||||
task = iscsi_itt_to_task(conn, itt);
|
||||
spin_unlock(&conn->session->back_lock);
|
||||
session = conn->session;
|
||||
spin_lock(&session->back_lock);
|
||||
task = iscsi_itt_to_task(session, conn, itt);
|
||||
spin_unlock(&session->back_lock);
|
||||
|
||||
if (task == NULL) {
|
||||
ql4_printk(KERN_ERR, ha, "%s: Task is NULL\n", __func__);
|
||||
|
|
|
|||
|
|
@ -474,17 +474,21 @@ extern int iscsi_conn_send_pdu(struct iscsi_cls_conn *, struct iscsi_hdr *,
|
|||
char *, uint32_t);
|
||||
extern int iscsi_complete_pdu(struct iscsi_conn *, struct iscsi_hdr *,
|
||||
char *, int);
|
||||
extern int __iscsi_complete_pdu(struct iscsi_conn *, struct iscsi_hdr *,
|
||||
extern int __iscsi_complete_pdu(struct iscsi_session *session,
|
||||
struct iscsi_conn *conn, struct iscsi_hdr *,
|
||||
char *, int);
|
||||
extern int iscsi_verify_itt(struct iscsi_conn *, itt_t);
|
||||
extern struct iscsi_task *iscsi_itt_to_ctask(struct iscsi_conn *, itt_t);
|
||||
extern struct iscsi_task *iscsi_itt_to_task(struct iscsi_conn *, itt_t);
|
||||
struct iscsi_task *iscsi_itt_to_ctask(struct iscsi_session *session,
|
||||
struct iscsi_conn *, itt_t);
|
||||
struct iscsi_task *iscsi_itt_to_task(struct iscsi_session *session,
|
||||
struct iscsi_conn *, itt_t);
|
||||
extern void iscsi_requeue_task(struct iscsi_task *task);
|
||||
extern void iscsi_put_task(struct iscsi_task *task);
|
||||
extern void __iscsi_put_task(struct iscsi_task *task);
|
||||
void __iscsi_put_task(struct iscsi_session *session, struct iscsi_task *task);
|
||||
extern bool iscsi_get_task(struct iscsi_task *task);
|
||||
extern void iscsi_complete_scsi_task(struct iscsi_task *task,
|
||||
uint32_t exp_cmdsn, uint32_t max_cmdsn);
|
||||
void iscsi_complete_scsi_task(struct iscsi_session *session,
|
||||
struct iscsi_task *task,
|
||||
uint32_t exp_cmdsn, uint32_t max_cmdsn);
|
||||
|
||||
/*
|
||||
* generic helpers
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user