Adds export of blk_rq_unmap_kern_sg(), which is needed if SCSI built as a module.
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Thu, 9 Jul 2009 17:48:28 +0000 (17:48 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Thu, 9 Jul 2009 17:48:28 +0000 (17:48 +0000)
Noticed by Bart Van Assche <bart.vanassche@gmail.com>

git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@944 d57e44dd-8a1f-0410-8b47-8ef2f437770f

scst/kernel/scst_exec_req_fifo-2.6.30.patch

index d387d66..59e3cd9 100644 (file)
@@ -1,6 +1,6 @@
 diff -upkr linux-2.6.30.1/block/blk-map.c linux-2.6.30.1/block/blk-map.c
 --- linux-2.6.30.1/block/blk-map.c     2009-06-10 07:05:27.000000000 +0400
-+++ linux-2.6.30.1/block/blk-map.c     2009-07-08 21:18:53.000000000 +0400
++++ linux-2.6.30.1/block/blk-map.c     2009-07-09 21:33:07.000000000 +0400
 @@ -5,6 +5,7 @@
  #include <linux/module.h>
  #include <linux/bio.h>
@@ -27,7 +27,7 @@ diff -upkr linux-2.6.30.1/block/blk-map.c linux-2.6.30.1/block/blk-map.c
  
        blk_queue_bounce(q, &bio);
        bio_get(bio);
-@@ -273,6 +274,532 @@ int blk_rq_unmap_user(struct bio *bio)
+@@ -273,6 +274,541 @@ int blk_rq_unmap_user(struct bio *bio)
  EXPORT_SYMBOL(blk_rq_unmap_user);
  
  /**
@@ -124,6 +124,14 @@ diff -upkr linux-2.6.30.1/block/blk-map.c linux-2.6.30.1/block/blk-map.c
 +}
 +EXPORT_SYMBOL(blk_copy_sg);
 +
++/**
++ * blk_rq_unmap_kern_sg - "unmaps" data buffers in the request
++ * @req:      request to unmap
++ * @do_copy:  sets copy data between buffers, if needed, or not
++ *
++ * Description:
++ *    It frees all additional buffers allocated for SG->BIO mapping.
++ */
 +void blk_rq_unmap_kern_sg(struct request *req, int do_copy)
 +{
 +      struct scatterlist *hdr = (struct scatterlist *)req->end_io_data;
@@ -181,6 +189,7 @@ diff -upkr linux-2.6.30.1/block/blk-map.c linux-2.6.30.1/block/blk-map.c
 +out:
 +      return;
 +}
++EXPORT_SYMBOL(blk_rq_unmap_kern_sg);
 +
 +static int blk_rq_handle_align_tail_only(struct request *rq,
 +                                       struct scatterlist *sg_to_copy,
@@ -560,7 +569,7 @@ diff -upkr linux-2.6.30.1/block/blk-map.c linux-2.6.30.1/block/blk-map.c
   * blk_rq_map_kern - map kernel data to a request, for REQ_TYPE_BLOCK_PC usage
   * @q:                request queue where request should be inserted
   * @rq:               request to fill
-@@ -309,7 +836,7 @@ int blk_rq_map_kern(struct request_queue
+@@ -309,7 +845,7 @@ int blk_rq_map_kern(struct request_queue
                bio->bi_rw |= (1 << BIO_RW);
  
        if (do_copy)
@@ -571,7 +580,7 @@ diff -upkr linux-2.6.30.1/block/blk-map.c linux-2.6.30.1/block/blk-map.c
        blk_queue_bounce(q, &rq->bio);
 diff -upkr linux-2.6.30.1/block/blk-merge.c linux-2.6.30.1/block/blk-merge.c
 --- linux-2.6.30.1/block/blk-merge.c   2009-06-10 07:05:27.000000000 +0400
-+++ linux-2.6.30.1/block/blk-merge.c   2009-07-08 21:18:53.000000000 +0400
++++ linux-2.6.30.1/block/blk-merge.c   2009-07-08 21:24:29.000000000 +0400
 @@ -198,7 +198,7 @@ new_segment:
        } /* segments in rq */
  
@@ -583,7 +592,7 @@ diff -upkr linux-2.6.30.1/block/blk-merge.c linux-2.6.30.1/block/blk-merge.c
  
 diff -upkr linux-2.6.30.1/drivers/scsi/scsi_lib.c linux-2.6.30.1/drivers/scsi/scsi_lib.c
 --- linux-2.6.30.1/drivers/scsi/scsi_lib.c     2009-06-10 07:05:27.000000000 +0400
-+++ linux-2.6.30.1/drivers/scsi/scsi_lib.c     2009-07-08 21:18:53.000000000 +0400
++++ linux-2.6.30.1/drivers/scsi/scsi_lib.c     2009-07-08 21:24:29.000000000 +0400
 @@ -277,6 +277,100 @@ int scsi_execute_req(struct scsi_device 
  }
  EXPORT_SYMBOL(scsi_execute_req);
@@ -727,7 +736,7 @@ diff -upkr linux-2.6.30.1/drivers/scsi/scsi_lib.c linux-2.6.30.1/drivers/scsi/sc
        for (i = 0; i < SG_MEMPOOL_NR; i++) {
 diff -upkr linux-2.6.30.1/include/linux/blkdev.h linux-2.6.30.1/include/linux/blkdev.h
 --- linux-2.6.30.1/include/linux/blkdev.h      2009-06-10 07:05:27.000000000 +0400
-+++ linux-2.6.30.1/include/linux/blkdev.h      2009-07-08 21:18:53.000000000 +0400
++++ linux-2.6.30.1/include/linux/blkdev.h      2009-07-08 21:24:29.000000000 +0400
 @@ -115,7 +115,7 @@ enum rq_flag_bits {
        __REQ_RW_SYNC,          /* request is sync (sync write or read) */
        __REQ_ALLOCED,          /* request came from our alloc pool */
@@ -768,7 +777,7 @@ diff -upkr linux-2.6.30.1/include/linux/blkdev.h linux-2.6.30.1/include/linux/bl
  struct request_queue *blk_alloc_queue_node(gfp_t, int);
 diff -upkr linux-2.6.30.1/include/scsi/scsi_device.h linux-2.6.30.1/include/scsi/scsi_device.h
 --- linux-2.6.30.1/include/scsi/scsi_device.h  2009-06-10 07:05:27.000000000 +0400
-+++ linux-2.6.30.1/include/scsi/scsi_device.h  2009-07-06 20:24:54.000000000 +0400
++++ linux-2.6.30.1/include/scsi/scsi_device.h  2009-07-08 21:24:29.000000000 +0400
 @@ -372,6 +372,17 @@ extern int scsi_execute_req(struct scsi_
                            struct scsi_sense_hdr *, int timeout, int retries,
                            int *resid);