[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1377029280-19144-10-git-send-email-nab@daterainc.com>
Date: Tue, 20 Aug 2013 20:08:00 +0000
From: "Nicholas A. Bellinger" <nab@...erainc.com>
To: target-devel <target-devel@...r.kernel.org>
Cc: lkml <linux-kernel@...r.kernel.org>,
linux-scsi <linux-scsi@...r.kernel.org>,
Christoph Hellwig <hch@....de>, Hannes Reinecke <hare@...e.de>,
Martin Petersen <martin.petersen@...cle.com>,
Chris Mason <chris.mason@...ionio.com>,
James Bottomley <JBottomley@...allels.com>,
Nicholas Bellinger <nab@...ux-iscsi.org>,
Nicholas Bellinger <nab@...erainc.com>,
Giridhar Malavali <giridhar.malavali@...gic.com>,
Chad Dupuis <chad.dupuis@...gic.com>
Subject: [PATCH 9/9] tcm_qla2xxx: Add special case for COMPARE_AND_WRITE data_direction
From: Nicholas Bellinger <nab@...erainc.com>
Add a special case for COMPARE_AND_WRITE for the reverse data direction
mapping used for pci_map_sg() + friends.
Cc: Christoph Hellwig <hch@....de>
Cc: Giridhar Malavali <giridhar.malavali@...gic.com>
Cc: Chad Dupuis <chad.dupuis@...gic.com>
Cc: Hannes Reinecke <hare@...e.de>
Cc: Martin Petersen <martin.petersen@...cle.com>
Cc: Chris Mason <chris.mason@...ionio.com>
Cc: James Bottomley <JBottomley@...allels.com>
Signed-off-by: Nicholas Bellinger <nab@...erainc.com>
---
drivers/scsi/qla2xxx/tcm_qla2xxx.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
index 6a93a91..4e20d51 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
@@ -508,8 +508,13 @@ static u32 tcm_qla2xxx_sess_get_index(struct se_session *se_sess)
*/
static enum dma_data_direction tcm_qla2xxx_mapping_dir(struct se_cmd *se_cmd)
{
- if (se_cmd->se_cmd_flags & SCF_BIDI)
- return DMA_BIDIRECTIONAL;
+ if (se_cmd->se_cmd_flags & SCF_BIDI) {
+ /*
+ * Special fall-through case for COMPARE_AND_WRITE
+ */
+ if (se_cmd->t_task_cdb[0] != COMPARE_AND_WRITE)
+ return DMA_BIDIRECTIONAL;
+ }
switch (se_cmd->data_direction) {
case DMA_TO_DEVICE:
--
1.7.10.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists