Commit 506e0798 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: use bio_release_pages in bio_map_user_iov

Use bio_release_pages instead of open coding it.
Reviewed-by: default avatarMinwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 163cc2d3
...@@ -1362,8 +1362,6 @@ struct bio *bio_map_user_iov(struct request_queue *q, ...@@ -1362,8 +1362,6 @@ struct bio *bio_map_user_iov(struct request_queue *q,
int j; int j;
struct bio *bio; struct bio *bio;
int ret; int ret;
struct bio_vec *bvec;
struct bvec_iter_all iter_all;
if (!iov_iter_count(iter)) if (!iov_iter_count(iter))
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
...@@ -1430,9 +1428,7 @@ struct bio *bio_map_user_iov(struct request_queue *q, ...@@ -1430,9 +1428,7 @@ struct bio *bio_map_user_iov(struct request_queue *q,
return bio; return bio;
out_unmap: out_unmap:
bio_for_each_segment_all(bvec, bio, iter_all) { bio_release_pages(bio, false);
put_page(bvec->bv_page);
}
bio_put(bio); bio_put(bio);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment