Merge pull request #398 from anatoliy-glagolev/master
checking if task is in outqueue
This commit is contained in:
@@ -1537,6 +1537,13 @@ EXTERN void scsi_task_set_iov_in(struct scsi_task *task, struct scsi_iovec *iov,
|
|||||||
|
|
||||||
EXTERN int scsi_task_get_status(struct scsi_task *task, struct scsi_sense *sense);
|
EXTERN int scsi_task_get_status(struct scsi_task *task, struct scsi_sense *sense);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This function returns 1 if the task is queued for send (for example, the task has been created
|
||||||
|
* with an asynchronous request and has not been put on the wire right away due to the socket
|
||||||
|
* or the ISCSI session state); otherwise returns 0.
|
||||||
|
*/
|
||||||
|
EXTERN int iscsi_scsi_is_task_in_outqueue(struct iscsi_context *iscsi, struct scsi_task *task);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function is used when you want to cancel a scsi task.
|
* This function is used when you want to cancel a scsi task.
|
||||||
* The callback for the task will immediately be invoked with SCSI_STATUS_CANCELLED.
|
* The callback for the task will immediately be invoked with SCSI_STATUS_CANCELLED.
|
||||||
|
|||||||
@@ -2675,6 +2675,19 @@ iscsi_scsi_get_task_from_pdu(struct iscsi_pdu *pdu)
|
|||||||
return pdu->scsi_cbdata.task;
|
return pdu->scsi_cbdata.task;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int iscsi_scsi_is_task_in_outqueue(struct iscsi_context *iscsi, struct scsi_task *task)
|
||||||
|
{
|
||||||
|
struct iscsi_pdu *pdu;
|
||||||
|
|
||||||
|
for (pdu = iscsi->outqueue; pdu; pdu = pdu->next) {
|
||||||
|
if (pdu->itt == task->itt) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
iscsi_scsi_cancel_task(struct iscsi_context *iscsi,
|
iscsi_scsi_cancel_task(struct iscsi_context *iscsi,
|
||||||
struct scsi_task *task)
|
struct scsi_task *task)
|
||||||
|
|||||||
Reference in New Issue
Block a user