zfcp: sg chaining support
authorFUJITA Tomonori <tomof@acm.org>
Mon, 30 Jul 2007 14:01:32 +0000 (23:01 +0900)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 16 Oct 2007 09:21:00 +0000 (11:21 +0200)
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
drivers/s390/scsi/zfcp_def.h
drivers/s390/scsi/zfcp_qdio.c

index 16e5563e0c651959aad3bd4e7cf7c90aacf0bfaf..57cac7008e0b4cbf6db25636e6921b7a958a4886 100644 (file)
@@ -34,6 +34,7 @@
 #include <linux/slab.h>
 #include <linux/mempool.h>
 #include <linux/syscalls.h>
+#include <linux/scatterlist.h>
 #include <linux/ioctl.h>
 #include <scsi/scsi.h>
 #include <scsi/scsi_tcq.h>
index 3f105fdcf239610b18e14a9617b90630b0444302..51d92b196ee716848268a79d4c8a7653b282e775 100644 (file)
@@ -590,7 +590,7 @@ zfcp_qdio_sbals_from_segment(struct zfcp_fsf_req *fsf_req, unsigned long sbtype,
  */
 int
 zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *fsf_req, unsigned long sbtype,
-                        struct scatterlist *sg,        int sg_count, int max_sbals)
+                        struct scatterlist *sgl, int sg_count, int max_sbals)
 {
        int sg_index;
        struct scatterlist *sg_segment;
@@ -606,9 +606,7 @@ zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *fsf_req, unsigned long sbtype,
        sbale->flags |= sbtype;
 
        /* process all segements of scatter-gather list */
-       for (sg_index = 0, sg_segment = sg, bytes = 0;
-            sg_index < sg_count;
-            sg_index++, sg_segment++) {
+       for_each_sg(sgl, sg_segment, sg_count, sg_index) {
                retval = zfcp_qdio_sbals_from_segment(
                                fsf_req,
                                sbtype,