diff options
author | Christoph Hellwig <hch@infradead.org> | 2012-05-20 11:59:11 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-07-16 20:25:55 -0400 |
commit | 64f1db38c65fa634f4aa21e0f70480a6b8b4d47c (patch) | |
tree | de8a6b08d9230ba7cb69a3c78174b351123747df /drivers/target/loopback | |
parent | cb4f4d3c7398a709b48d397e0520ee2509a953a4 (diff) |
target: remove control CDB flags
We don't need three flags to classifiy the CDB as we can check for a NULL S/G
list for a dataless command, and can infer from the absence of the data flag
that we deal with a control CDB. Also remove the _SG_IO from the data CDB
flag as all I/O is dont on S/G lists now.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/loopback')
-rw-r--r-- | drivers/target/loopback/tcm_loop.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 38dfac2b0a1c..f65dc9db8596 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c | |||
@@ -211,12 +211,11 @@ static void tcm_loop_submission_work(struct work_struct *work) | |||
211 | /* | 211 | /* |
212 | * Because some userspace code via scsi-generic do not memset their | 212 | * Because some userspace code via scsi-generic do not memset their |
213 | * associated read buffers, go ahead and do that here for type | 213 | * associated read buffers, go ahead and do that here for type |
214 | * SCF_SCSI_CONTROL_SG_IO_CDB. Also note that this is currently | 214 | * non-data CDBs. Also note that this is currently guaranteed to be a |
215 | * guaranteed to be a single SGL for SCF_SCSI_CONTROL_SG_IO_CDB | 215 | * single SGL for this case by target core in |
216 | * by target core in target_setup_cmd_from_cdb() -> | 216 | * target_setup_cmd_from_cdb() -> transport_generic_cmd_sequencer(). |
217 | * transport_generic_cmd_sequencer(). | ||
218 | */ | 217 | */ |
219 | if (se_cmd->se_cmd_flags & SCF_SCSI_CONTROL_SG_IO_CDB && | 218 | if (!(se_cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) && |
220 | se_cmd->data_direction == DMA_FROM_DEVICE) { | 219 | se_cmd->data_direction == DMA_FROM_DEVICE) { |
221 | struct scatterlist *sg = scsi_sglist(sc); | 220 | struct scatterlist *sg = scsi_sglist(sc); |
222 | unsigned char *buf = kmap(sg_page(sg)) + sg->offset; | 221 | unsigned char *buf = kmap(sg_page(sg)) + sg->offset; |