diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-12-21 14:13:47 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-02-25 17:37:45 -0500 |
commit | 7d680f3b74dd6f0f57569eeeee8c257790ceaa96 (patch) | |
tree | e0797ab722c222213b7cbe4fa9ba4a61db2d8b0c /include/target | |
parent | b01543dfe67bb1d191998e90d20534dc354de059 (diff) |
target: replace various cmd flags with a transport state
Replace various atomic_ts used as flags in struct se_cmd with a single
transport_state bitmap that requires t_state_lock to be held for modifications.
In the target core that assumption generally is true, but some recently added
code in the SRP target had to grow new lock calls. I can't say I like the way
how it messes with the command state directly, but let's leave that for later.
(Re-add missing ib_srpt.c changes that nab dropped..)
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target')
-rw-r--r-- | include/target/target_core_base.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index dc4e345a0163..9e7a6a5451c2 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -555,23 +555,24 @@ struct se_cmd { | |||
555 | unsigned char *t_task_cdb; | 555 | unsigned char *t_task_cdb; |
556 | unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; | 556 | unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; |
557 | unsigned long long t_task_lba; | 557 | unsigned long long t_task_lba; |
558 | int t_tasks_failed; | ||
559 | u32 t_tasks_sg_chained_no; | 558 | u32 t_tasks_sg_chained_no; |
560 | atomic_t t_fe_count; | 559 | atomic_t t_fe_count; |
561 | atomic_t t_se_count; | 560 | atomic_t t_se_count; |
562 | atomic_t t_task_cdbs_left; | 561 | atomic_t t_task_cdbs_left; |
563 | atomic_t t_task_cdbs_ex_left; | 562 | atomic_t t_task_cdbs_ex_left; |
564 | atomic_t t_task_cdbs_sent; | 563 | atomic_t t_task_cdbs_sent; |
565 | atomic_t t_transport_aborted; | 564 | unsigned int transport_state; |
566 | atomic_t t_transport_active; | 565 | #define CMD_T_ABORTED (1 << 0) |
567 | atomic_t t_transport_complete; | 566 | #define CMD_T_ACTIVE (1 << 1) |
568 | atomic_t t_transport_queue_active; | 567 | #define CMD_T_COMPLETE (1 << 2) |
569 | atomic_t t_transport_sent; | 568 | #define CMD_T_QUEUED (1 << 3) |
570 | atomic_t t_transport_stop; | 569 | #define CMD_T_SENT (1 << 4) |
571 | atomic_t transport_dev_active; | 570 | #define CMD_T_STOP (1 << 5) |
571 | #define CMD_T_FAILED (1 << 6) | ||
572 | #define CMD_T_LUN_STOP (1 << 7) | ||
573 | #define CMD_T_LUN_FE_STOP (1 << 8) | ||
574 | #define CMD_T_DEV_ACTIVE (1 << 9) | ||
572 | atomic_t transport_lun_active; | 575 | atomic_t transport_lun_active; |
573 | atomic_t transport_lun_fe_stop; | ||
574 | atomic_t transport_lun_stop; | ||
575 | spinlock_t t_state_lock; | 576 | spinlock_t t_state_lock; |
576 | struct completion t_transport_stop_comp; | 577 | struct completion t_transport_stop_comp; |
577 | struct completion transport_lun_fe_stop_comp; | 578 | struct completion transport_lun_fe_stop_comp; |