diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-11-14 11:36:30 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-12-06 01:00:53 -0500 |
commit | 33c3fafc43e56a22be60ebe67bec5ba763d51010 (patch) | |
tree | 87a482353c77ff469b4d7b4fab8df105087d8cf9 | |
parent | 2d3a4b51df4db2ee0415f42a63b9629a7977b975 (diff) |
target: remove the t_tasks_bidi se_cmd field
And use a SCF_BIDI flag instead.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r-- | drivers/target/loopback/tcm_loop.c | 8 | ||||
-rw-r--r-- | drivers/target/target_core_transport.c | 2 | ||||
-rw-r--r-- | include/target/target_core_base.h | 2 |
3 files changed, 5 insertions, 7 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 0ca89f02e26f..81d5832fbbd5 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c | |||
@@ -113,11 +113,9 @@ static struct se_cmd *tcm_loop_allocate_core_cmd( | |||
113 | scsi_bufflen(sc), sc->sc_data_direction, sam_task_attr, | 113 | scsi_bufflen(sc), sc->sc_data_direction, sam_task_attr, |
114 | &tl_cmd->tl_sense_buf[0]); | 114 | &tl_cmd->tl_sense_buf[0]); |
115 | 115 | ||
116 | /* | ||
117 | * Signal BIDI usage with T_TASK(cmd)->t_tasks_bidi | ||
118 | */ | ||
119 | if (scsi_bidi_cmnd(sc)) | 116 | if (scsi_bidi_cmnd(sc)) |
120 | se_cmd->t_tasks_bidi = 1; | 117 | se_cmd->se_cmd_flags |= SCF_BIDI; |
118 | |||
121 | /* | 119 | /* |
122 | * Locate the struct se_lun pointer and attach it to struct se_cmd | 120 | * Locate the struct se_lun pointer and attach it to struct se_cmd |
123 | */ | 121 | */ |
@@ -154,7 +152,7 @@ static int tcm_loop_new_cmd_map(struct se_cmd *se_cmd) | |||
154 | * For BIDI commands, pass in the extra READ buffer | 152 | * For BIDI commands, pass in the extra READ buffer |
155 | * to transport_generic_map_mem_to_cmd() below.. | 153 | * to transport_generic_map_mem_to_cmd() below.. |
156 | */ | 154 | */ |
157 | if (se_cmd->t_tasks_bidi) { | 155 | if (se_cmd->se_cmd_flags & SCF_BIDI) { |
158 | struct scsi_data_buffer *sdb = scsi_in(sc); | 156 | struct scsi_data_buffer *sdb = scsi_in(sc); |
159 | 157 | ||
160 | sgl_bidi = sdb->table.sgl; | 158 | sgl_bidi = sdb->table.sgl; |
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 866af5d5869f..8f29f472c50b 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -2598,7 +2598,7 @@ static int transport_generic_cmd_sequencer( | |||
2598 | break; | 2598 | break; |
2599 | case XDWRITEREAD_10: | 2599 | case XDWRITEREAD_10: |
2600 | if ((cmd->data_direction != DMA_TO_DEVICE) || | 2600 | if ((cmd->data_direction != DMA_TO_DEVICE) || |
2601 | !(cmd->t_tasks_bidi)) | 2601 | !(cmd->se_cmd_flags & SCF_BIDI)) |
2602 | goto out_invalid_cdb_field; | 2602 | goto out_invalid_cdb_field; |
2603 | sectors = transport_get_sectors_10(cdb, cmd, §or_ret); | 2603 | sectors = transport_get_sectors_10(cdb, cmd, §or_ret); |
2604 | if (sector_ret) | 2604 | if (sector_ret) |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 357af4546d25..3f9e4da5bd9f 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -106,6 +106,7 @@ enum se_cmd_flags_table { | |||
106 | SCF_FUA = 0x00000200, | 106 | SCF_FUA = 0x00000200, |
107 | SCF_SE_LUN_CMD = 0x00000800, | 107 | SCF_SE_LUN_CMD = 0x00000800, |
108 | SCF_SE_ALLOW_EOO = 0x00001000, | 108 | SCF_SE_ALLOW_EOO = 0x00001000, |
109 | SCF_BIDI = 0x00002000, | ||
109 | SCF_SENT_CHECK_CONDITION = 0x00004000, | 110 | SCF_SENT_CHECK_CONDITION = 0x00004000, |
110 | SCF_OVERFLOW_BIT = 0x00008000, | 111 | SCF_OVERFLOW_BIT = 0x00008000, |
111 | SCF_UNDERFLOW_BIT = 0x00010000, | 112 | SCF_UNDERFLOW_BIT = 0x00010000, |
@@ -459,7 +460,6 @@ struct se_cmd { | |||
459 | unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; | 460 | unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; |
460 | unsigned long long t_task_lba; | 461 | unsigned long long t_task_lba; |
461 | int t_tasks_failed; | 462 | int t_tasks_failed; |
462 | bool t_tasks_bidi; | ||
463 | u32 t_tasks_sg_chained_no; | 463 | u32 t_tasks_sg_chained_no; |
464 | atomic_t t_fe_count; | 464 | atomic_t t_fe_count; |
465 | atomic_t t_se_count; | 465 | atomic_t t_se_count; |