Commit 57dfe3ce authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

block_dev: use bio_release_pages in blkdev_bio_end_io



Use bio_release_pages instead of duplicating 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 147a6053
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -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);
	}
}