summaryrefslogtreecommitdiffstats
path: root/block/bio.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-06-26 15:49:23 +0200
committerJens Axboe <axboe@kernel.dk>2019-06-29 09:47:31 -0600
commit506e0798479ed54d48f063547b1b62d33b18d54c (patch)
tree7fd7e0c2ad0aab0e7f95d163ec1f2b1b8ce2fee1 /block/bio.c
parent163cc2d3cd87af82b589bc2327285505eeac3842 (diff)
downloadlinux-506e0798479ed54d48f063547b1b62d33b18d54c.tar.bz2
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/bio.c')
-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,
int j;
struct bio *bio;
int ret;
- struct bio_vec *bvec;
- struct bvec_iter_all iter_all;
if (!iov_iter_count(iter))
return ERR_PTR(-EINVAL);
@@ -1430,9 +1428,7 @@ struct bio *bio_map_user_iov(struct request_queue *q,
return bio;
out_unmap:
- bio_for_each_segment_all(bvec, bio, iter_all) {
- put_page(bvec->bv_page);
- }
+ bio_release_pages(bio, false);
bio_put(bio);
return ERR_PTR(ret);
}