aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-08-28 03:17:06 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 02:56:10 -0400
commit152e283fdfea0cd11e297d982378b55937842dde (patch)
treea97a57108353f167a1e2911e8ee09c527ef42d3e /include
parenta3bce90edd8f6cafe3f63b1a943800792e830178 (diff)
block: introduce struct rq_map_data to use reserved pages
This patch introduces struct rq_map_data to enable bio_copy_use_iov() use reserved pages. Currently, bio_copy_user_iov allocates bounce pages but drivers/scsi/sg.c wants to allocate pages by itself and use them. struct rq_map_data can be used to pass allocated pages to bio_copy_user_iov. The current users of bio_copy_user_iov simply passes NULL (they don't want to use pre-allocated pages). Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Douglas Gilbert <dougg@torque.net> Cc: Mike Christie <michaelc@cs.wisc.edu> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/bio.h8
-rw-r--r--include/linux/blkdev.h12
2 files changed, 15 insertions, 5 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 200b185c3e8..bc386cd5e99 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -327,6 +327,7 @@ extern int bio_get_nr_vecs(struct block_device *);
327extern struct bio *bio_map_user(struct request_queue *, struct block_device *, 327extern struct bio *bio_map_user(struct request_queue *, struct block_device *,
328 unsigned long, unsigned int, int, gfp_t); 328 unsigned long, unsigned int, int, gfp_t);
329struct sg_iovec; 329struct sg_iovec;
330struct rq_map_data;
330extern struct bio *bio_map_user_iov(struct request_queue *, 331extern struct bio *bio_map_user_iov(struct request_queue *,
331 struct block_device *, 332 struct block_device *,
332 struct sg_iovec *, int, int, gfp_t); 333 struct sg_iovec *, int, int, gfp_t);
@@ -337,9 +338,10 @@ extern struct bio *bio_copy_kern(struct request_queue *, void *, unsigned int,
337 gfp_t, int); 338 gfp_t, int);
338extern void bio_set_pages_dirty(struct bio *bio); 339extern void bio_set_pages_dirty(struct bio *bio);
339extern void bio_check_pages_dirty(struct bio *bio); 340extern void bio_check_pages_dirty(struct bio *bio);
340extern struct bio *bio_copy_user(struct request_queue *, unsigned long, 341extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *,
341 unsigned int, int, gfp_t); 342 unsigned long, unsigned int, int, gfp_t);
342extern struct bio *bio_copy_user_iov(struct request_queue *, struct sg_iovec *, 343extern struct bio *bio_copy_user_iov(struct request_queue *,
344 struct rq_map_data *, struct sg_iovec *,
343 int, int, gfp_t); 345 int, int, gfp_t);
344extern int bio_uncopy_user(struct bio *); 346extern int bio_uncopy_user(struct bio *);
345void zero_fill_bio(struct bio *bio); 347void zero_fill_bio(struct bio *bio);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 00e388d0e22..358ac423ed2 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -642,6 +642,12 @@ static inline void blk_queue_bounce(struct request_queue *q, struct bio **bio)
642} 642}
643#endif /* CONFIG_MMU */ 643#endif /* CONFIG_MMU */
644 644
645struct rq_map_data {
646 struct page **pages;
647 int page_order;
648 int nr_entries;
649};
650
645struct req_iterator { 651struct req_iterator {
646 int i; 652 int i;
647 struct bio *bio; 653 struct bio *bio;
@@ -711,11 +717,13 @@ extern void __blk_run_queue(struct request_queue *);
711extern void blk_run_queue(struct request_queue *); 717extern void blk_run_queue(struct request_queue *);
712extern void blk_start_queueing(struct request_queue *); 718extern void blk_start_queueing(struct request_queue *);
713extern int blk_rq_map_user(struct request_queue *, struct request *, 719extern int blk_rq_map_user(struct request_queue *, struct request *,
714 void __user *, unsigned long, gfp_t); 720 struct rq_map_data *, void __user *, unsigned long,
721 gfp_t);
715extern int blk_rq_unmap_user(struct bio *); 722extern int blk_rq_unmap_user(struct bio *);
716extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t); 723extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t);
717extern int blk_rq_map_user_iov(struct request_queue *, struct request *, 724extern int blk_rq_map_user_iov(struct request_queue *, struct request *,
718 struct sg_iovec *, int, unsigned int, gfp_t); 725 struct rq_map_data *, struct sg_iovec *, int,
726 unsigned int, gfp_t);
719extern int blk_execute_rq(struct request_queue *, struct gendisk *, 727extern int blk_execute_rq(struct request_queue *, struct gendisk *,
720 struct request *, int); 728 struct request *, int);
721extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, 729extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *,