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