summaryrefslogtreecommitdiffstats
path: root/include/target
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-12-21 14:13:47 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2012-02-25 14:37:45 -0800
commit7d680f3b74dd6f0f57569eeeee8c257790ceaa96 (patch)
treee0797ab722c222213b7cbe4fa9ba4a61db2d8b0c /include/target
parentb01543dfe67bb1d191998e90d20534dc354de059 (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.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index dc4e345a016..9e7a6a5451c 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -555,23 +555,24 @@ struct se_cmd {
unsigned char *t_task_cdb;
unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE];
unsigned long long t_task_lba;
- int t_tasks_failed;
u32 t_tasks_sg_chained_no;
atomic_t t_fe_count;
atomic_t t_se_count;
atomic_t t_task_cdbs_left;
atomic_t t_task_cdbs_ex_left;
atomic_t t_task_cdbs_sent;
- atomic_t t_transport_aborted;
- atomic_t t_transport_active;
- atomic_t t_transport_complete;
- atomic_t t_transport_queue_active;
- atomic_t t_transport_sent;
- atomic_t t_transport_stop;
- atomic_t transport_dev_active;
+ unsigned int transport_state;
+#define CMD_T_ABORTED (1 << 0)
+#define CMD_T_ACTIVE (1 << 1)
+#define CMD_T_COMPLETE (1 << 2)
+#define CMD_T_QUEUED (1 << 3)
+#define CMD_T_SENT (1 << 4)
+#define CMD_T_STOP (1 << 5)
+#define CMD_T_FAILED (1 << 6)
+#define CMD_T_LUN_STOP (1 << 7)
+#define CMD_T_LUN_FE_STOP (1 << 8)
+#define CMD_T_DEV_ACTIVE (1 << 9)
atomic_t transport_lun_active;
- atomic_t transport_lun_fe_stop;
- atomic_t transport_lun_stop;
spinlock_t t_state_lock;
struct completion t_transport_stop_comp;
struct completion transport_lun_fe_stop_comp;