OSDN Git Service
(root)
/
tomoyo
/
tomoyo-test1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6143f6f
)
scsi: iscsi: Add task completion helper
author
Mike Christie
<michael.christie@oracle.com>
Tue, 25 May 2021 18:17:54 +0000
(13:17 -0500)
committer
Martin K. Petersen
<martin.petersen@oracle.com>
Wed, 2 Jun 2021 05:28:19 +0000
(
01:28
-0400)
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.com
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
include/scsi/libiscsi.h
patch
|
blob
|
history
diff --git
a/include/scsi/libiscsi.h
b/include/scsi/libiscsi.h
index
02f966e
..
8c6d358
100644
(file)
--- a/
include/scsi/libiscsi.h
+++ b/
include/scsi/libiscsi.h
@@
-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,