Skip to content

Commit

Permalink
block_dev: use bio_release_pages in blkdev_bio_end_io
Browse files Browse the repository at this point in the history
Use bio_release_pages instead of duplicating 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>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Jun 29, 2019
1 parent 147a605 commit 57dfe3c
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions fs/block_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,13 +335,7 @@ static void blkdev_bio_end_io(struct bio *bio)
if (should_dirty) {
bio_check_pages_dirty(bio);
} else {
if (!bio_flagged(bio, BIO_NO_PAGE_REF)) {
struct bvec_iter_all iter_all;
struct bio_vec *bvec;

bio_for_each_segment_all(bvec, bio, iter_all)
put_page(bvec->bv_page);
}
bio_release_pages(bio, false);
bio_put(bio);
}
}
Expand Down

0 comments on commit 57dfe3c

Please sign in to comment.