Re: [PATCH RFC/RFT 1/4] add some block layer helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mike Christie wrote:
add blk_rq_map_kern_iov() which takes a iovec of buffers then
maps them into bios and a request. It can make them into multiple
bios to support sg and st's large requests and avoid the BIO_MAX_PAGES
limit.

Signed-off-by: Mike Christie <michaelc@xxxxxxxxxxx>

diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
--- a/drivers/block/ll_rw_blk.c
+++ b/drivers/block/ll_rw_blk.c
@@ -28,6 +28,7 @@
 #include <linux/slab.h>
 #include <linux/swap.h>
 #include <linux/writeback.h>
+#include <linux/uio.h>
 #include <linux/blkdev.h>
/* @@ -2278,6 +2279,70 @@ int blk_rq_map_kern(request_queue_t *q, EXPORT_SYMBOL(blk_rq_map_kern); /**
+ * blk_rq_map_kern_iov - map kernel data to a request, for REQ_BLOCK_PC usage
+ * @q:		request queue where request should be inserted
+ * @rq:		request to fill
+ * @vec:	pointer to kvec
+ * @vec_count:	number of elements in kvec
+ * @gfp_mask:	memory allocation flags
+ *
+ * blk_rq_map_kern_iov maps a kvec into a multiple bio request so that
+ * it can create very large requests.
+ *
+ * For now we assume that each element will fit in one bio
+ */
+int blk_rq_map_kern_iov(request_queue_t *q, struct request *rq,
+			struct kvec *vec, int vec_count, unsigned int gfp)
+{

On second thought, I think this function should work on pages and not kernel addresses. It also has a leak in the error path.
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux