aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-06-26 09:49:23 -0400
committerJens Axboe <axboe@kernel.dk>2019-06-29 11:47:31 -0400
commit506e0798479ed54d48f063547b1b62d33b18d54c (patch)
tree7fd7e0c2ad0aab0e7f95d163ec1f2b1b8ce2fee1 /block
parent163cc2d3cd87af82b589bc2327285505eeac3842 (diff)
block: use bio_release_pages in bio_map_user_iov
Use bio_release_pages instead of open coding it. Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/bio.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/block/bio.c b/block/bio.c
index c759f5598513..1cbf2a7c245e 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1362,8 +1362,6 @@ struct bio *bio_map_user_iov(struct request_queue *q,
1362 int j; 1362 int j;
1363 struct bio *bio; 1363 struct bio *bio;
1364 int ret; 1364 int ret;
1365 struct bio_vec *bvec;
1366 struct bvec_iter_all iter_all;
1367 1365
1368 if (!iov_iter_count(iter)) 1366 if (!iov_iter_count(iter))
1369 return ERR_PTR(-EINVAL); 1367 return ERR_PTR(-EINVAL);
@@ -1430,9 +1428,7 @@ struct bio *bio_map_user_iov(struct request_queue *q,
1430 return bio; 1428 return bio;
1431 1429
1432 out_unmap: 1430 out_unmap:
1433 bio_for_each_segment_all(bvec, bio, iter_all) { 1431 bio_release_pages(bio, false);
1434 put_page(bvec->bv_page);
1435 }
1436 bio_put(bio); 1432 bio_put(bio);
1437 return ERR_PTR(ret); 1433 return ERR_PTR(ret);
1438} 1434}