aboutsummaryrefslogtreecommitdiffstats
path: root/fs/bio.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-09-02 03:20:19 -0400
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 02:56:11 -0400
commit818827669d85b84241696ffef2de485db46b0b5e (patch)
tree694d09728733e65d604bf3e1f13679db73fc1d9a /fs/bio.c
parent839e96afba87117befd39cf4e43f156edc8047a7 (diff)
block: make blk_rq_map_user take a NULL user-space buffer
This patch changes blk_rq_map_user to accept a NULL user-space buffer with a READ command if rq_map_data is not NULL. Thus a caller can pass page frames to lk_rq_map_user to just set up a request and bios with page frames propely. bio_uncopy_user (called via blk_rq_unmap_user) doesn't copy data to user space with such request. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs/bio.c')
-rw-r--r--fs/bio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/bio.c b/fs/bio.c
index 9d68ddb89b71..355302985e22 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -547,11 +547,11 @@ static int __bio_copy_iov(struct bio *bio, struct bio_vec *iovecs,
547int bio_uncopy_user(struct bio *bio) 547int bio_uncopy_user(struct bio *bio)
548{ 548{
549 struct bio_map_data *bmd = bio->bi_private; 549 struct bio_map_data *bmd = bio->bi_private;
550 int ret; 550 int ret = 0;
551
552 ret = __bio_copy_iov(bio, bmd->iovecs, bmd->sgvecs, bmd->nr_sgvecs, 1,
553 bmd->is_our_pages);
554 551
552 if (!bio_flagged(bio, BIO_NULL_MAPPED))
553 ret = __bio_copy_iov(bio, bmd->iovecs, bmd->sgvecs,
554 bmd->nr_sgvecs, 1, bmd->is_our_pages);
555 bio_free_map_data(bmd); 555 bio_free_map_data(bmd);
556 bio_put(bio); 556 bio_put(bio);
557 return ret; 557 return ret;