Pull bugzilla-5452 into release branch
[sfrench/cifs-2.6.git] / drivers / infiniband / ulp / srp / ib_srp.h
index b564f18caf783049ee1b95bfe6c2c8b3be0bd65f..c5cd43aae8604af42fb349b160e608a10a84c16d 100644 (file)
@@ -37,8 +37,8 @@
 
 #include <linux/types.h>
 #include <linux/list.h>
-
-#include <asm/semaphore.h>
+#include <linux/mutex.h>
+#include <linux/scatterlist.h>
 
 #include <scsi/scsi_host.h>
 #include <scsi/scsi_cmnd.h>
@@ -85,7 +85,7 @@ struct srp_host {
        struct ib_mr           *mr;
        struct class_device     class_dev;
        struct list_head        target_list;
-       struct semaphore        target_mutex;
+       struct mutex            target_mutex;
        struct completion       released;
        struct list_head        list;
 };
@@ -95,9 +95,13 @@ 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;
+       short                   index;
        u8                      cmd_done;
        u8                      tsk_status;
 };
@@ -129,7 +133,7 @@ struct srp_target_port {
        unsigned                tx_tail;
        struct srp_iu          *tx_ring[SRP_SQ_SIZE + 1];
 
-       int                     req_head;
+       struct list_head        free_reqs;
        struct list_head        req_queue;
        struct srp_request      req_ring[SRP_SQ_SIZE];