Skip to content

Commit 1486a4f

Browse files
mikechristiemartinkpetersen
authored andcommitted
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/[email protected] Reviewed-by: Lee Duncan <[email protected]> Signed-off-by: Mike Christie <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 6143f6f commit 1486a4f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/scsi/libiscsi.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,13 @@ static inline void* iscsi_next_hdr(struct iscsi_task *task)
145145
return (void*)task->hdr + task->hdr_len;
146146
}
147147

148+
static inline bool iscsi_task_is_completed(struct iscsi_task *task)
149+
{
150+
return task->state == ISCSI_TASK_COMPLETED ||
151+
task->state == ISCSI_TASK_ABRT_TMF ||
152+
task->state == ISCSI_TASK_ABRT_SESS_RECOV;
153+
}
154+
148155
/* Connection's states */
149156
enum {
150157
ISCSI_CONN_INITIAL_STAGE,

0 commit comments

Comments
 (0)