Skip to content

Commit

Permalink
block: use bio_release_pages in bio_map_user_iov
Browse files Browse the repository at this point in the history
Use bio_release_pages instead of open coding it.

Reviewed-by: Minwoo Im <[email protected]>
Reviewed-by: Chaitanya Kulkarni <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Christoph Hellwig authored and axboe committed Jun 29, 2019
1 parent 163cc2d commit 506e079
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions block/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 506e079

Please sign in to comment.