提交 1486a4f5 编写于 作者: M Mike Christie 提交者: Martin K. Petersen

scsi: iscsi: Add task completion helper

This adds a helper to detect if a cmd has completed but is not yet freed.

Link: https://lore.kernel.org/r/20210525181821.7617-2-michael.christie@oracle.comReviewed-by: NLee Duncan <lduncan@suse.com>
Signed-off-by: NMike Christie <michael.christie@oracle.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 6143f6f6
......@@ -145,6 +145,13 @@ static inline void* iscsi_next_hdr(struct iscsi_task *task)
return (void*)task->hdr + task->hdr_len;
}
static inline bool iscsi_task_is_completed(struct iscsi_task *task)
{
return task->state == ISCSI_TASK_COMPLETED ||
task->state == ISCSI_TASK_ABRT_TMF ||
task->state == ISCSI_TASK_ABRT_SESS_RECOV;
}
/* Connection's states */
enum {
ISCSI_CONN_INITIAL_STAGE,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册