summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srp/ib_srp.h
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2006-03-24 15:47:26 -0800
committerRoland Dreier <rolandd@cisco.com>2006-03-24 15:47:26 -0800
commitcf368713a3f3b2eb737a92d1b7186dedcc51167c (patch)
tree450791a25611cf98bde1540a3c366d0e2a6ba117 /drivers/infiniband/ulp/srp/ib_srp.h
parent6f633c8d69415aabbccfcc494008e8e1300a98c1 (diff)
downloadop-kernel-dev-cf368713a3f3b2eb737a92d1b7186dedcc51167c.zip
op-kernel-dev-cf368713a3f3b2eb737a92d1b7186dedcc51167c.tar.gz
IB/srp: Use a fake scatterlist for non-SG SCSI commands
Since the SCSI midlayer is moving towards entirely getting rid of commands with use_sg == 0, we should treat this case as an exception. Therefore, change the IB SRP initiator to create a fake scatterlist for these commands with sg_init_one(). This simplifies the flow of DMA mapping and unmapping, since SRP can just use dma_map_sg() and dma_unmap_sg() unconditionally, rather than having to choose between the dma_{map,unmap}_sg() and dma_{map,unmap}_single() variants. Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp/srp/ib_srp.h')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
index 4e7727d..bd7f7c3 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.h
+++ b/drivers/infiniband/ulp/srp/ib_srp.h
@@ -38,6 +38,7 @@
#include <linux/types.h>
#include <linux/list.h>
#include <linux/mutex.h>
+#include <linux/scatterlist.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_cmnd.h>
@@ -94,7 +95,11 @@ struct srp_request {
struct scsi_cmnd *scmnd;
struct srp_iu *cmd;
struct srp_iu *tsk_mgmt;
- DECLARE_PCI_UNMAP_ADDR(direct_mapping)
+ /*
+ * Fake scatterlist used when scmnd->use_sg==0. Can be killed
+ * when the SCSI midlayer no longer generates non-SG commands.
+ */
+ struct scatterlist fake_sg;
struct completion done;
short next;
u8 cmd_done;
OpenPOWER on IntegriCloud