From 950a06bab86b2fc98ab11900560ff721c17fc277 Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Mon, 15 Oct 2007 15:41:20 -0500 Subject: [PATCH 2/5] rm block device arg from bio map user functions Everyone is passing in NULL, so let's just drop the block device argument from the bio mapping functions. Signed-off-by: Mike Christie --- block/ll_rw_blk.c | 4 ++-- fs/bio.c | 15 +++++---------- include/linux/bio.h | 4 +--- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 3f2c0d4..c227364 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c @@ -2390,7 +2390,7 @@ static int __blk_rq_map_user(struct request_queue *q, struct request *rq, */ uaddr = (unsigned long) ubuf; if (!(uaddr & queue_dma_alignment(q)) && !(len & queue_dma_alignment(q))) - bio = bio_map_user(q, blk_bioset, NULL, uaddr, len, reading); + bio = bio_map_user(q, blk_bioset, uaddr, len, reading); else bio = bio_copy_user(q, blk_bioset, uaddr, len, reading); @@ -2516,7 +2516,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, /* we don't allow misaligned data like bio_map_user() does. If the * user is using sg, they're expected to know the alignment constraints * and respect them accordingly */ - bio = bio_map_user_iov(q, blk_bioset, NULL, iov, iov_count, + bio = bio_map_user_iov(q, blk_bioset, iov, iov_count, rq_data_dir(rq)== READ); if (IS_ERR(bio)) return PTR_ERR(bio); diff --git a/fs/bio.c b/fs/bio.c index 4ed5dfa..5f0b2d7 100644 --- a/fs/bio.c +++ b/fs/bio.c @@ -604,7 +604,6 @@ out_bmd: static struct bio *__bio_map_user_iov(struct request_queue *q, struct bio_set *bs, - struct block_device *bdev, struct sg_iovec *iov, int iov_count, int write_to_vm) { @@ -697,7 +696,6 @@ static struct bio *__bio_map_user_iov(struct request_queue *q, if (!write_to_vm) bio->bi_rw |= (1 << BIO_RW); - bio->bi_bdev = bdev; bio->bi_flags |= (1 << BIO_USER_MAPPED); return bio; @@ -717,7 +715,6 @@ static struct bio *__bio_map_user_iov(struct request_queue *q, * bio_map_user - map user address into bio * @q: the struct request_queue for the bio * @bs: bio set - * @bdev: destination block device * @uaddr: start of user address * @len: length in bytes * @write_to_vm: bool indicating writing to pages or not @@ -726,22 +723,20 @@ static struct bio *__bio_map_user_iov(struct request_queue *q, * device. Returns an error pointer in case of error. */ struct bio *bio_map_user(struct request_queue *q, struct bio_set *bs, - struct block_device *bdev, unsigned long uaddr, - unsigned int len, int write_to_vm) + unsigned long uaddr, unsigned int len, int write_to_vm) { struct sg_iovec iov; iov.iov_base = (void __user *)uaddr; iov.iov_len = len; - return bio_map_user_iov(q, bs, bdev, &iov, 1, write_to_vm); + return bio_map_user_iov(q, bs, &iov, 1, write_to_vm); } /** * bio_map_user_iov - map user sg_iovec table into bio * @q: the struct request_queue for the bio * @bs: bio set - * @bdev: destination block device * @iov: the iovec. * @iov_count: number of elements in the iovec * @write_to_vm: bool indicating writing to pages or not @@ -750,12 +745,12 @@ struct bio *bio_map_user(struct request_queue *q, struct bio_set *bs, * device. Returns an error pointer in case of error. */ struct bio *bio_map_user_iov(struct request_queue *q, struct bio_set *bs, - struct block_device *bdev, struct sg_iovec *iov, - int iov_count, int write_to_vm) + struct sg_iovec *iov, int iov_count, + int write_to_vm) { struct bio *bio; - bio = __bio_map_user_iov(q, bs, bdev, iov, iov_count, write_to_vm); + bio = __bio_map_user_iov(q, bs, iov, iov_count, write_to_vm); if (IS_ERR(bio)) return bio; diff --git a/include/linux/bio.h b/include/linux/bio.h index 8b2178a..978f964 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -301,11 +301,9 @@ extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, unsigned int, unsigned int); extern int bio_get_nr_vecs(struct block_device *); extern struct bio *bio_map_user(struct request_queue *, struct bio_set *, - struct block_device *, unsigned long, - unsigned int, int); + unsigned long, unsigned int, int); struct sg_iovec; extern struct bio *bio_map_user_iov(struct request_queue *, struct bio_set *, - struct block_device *, struct sg_iovec *, int, int); extern void bio_unmap_user(struct bio *); extern struct bio *bio_map_kern(struct request_queue *, struct bio_set *, -- 1.5.1.2