iomap: use bio_release_pages in iomap_dio_bio_end_io
authorChristoph Hellwig <hch@lst.de>
Wed, 26 Jun 2019 13:49:24 +0000 (15:49 +0200)
committerJens Axboe <axboe@kernel.dk>
Sat, 29 Jun 2019 15:47:31 +0000 (09:47 -0600)
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>
fs/iomap.c

index 23ef63fd166951e1c05f34875f661288fefb6ae7..3798eaf789d7df3758e52f083ae44f5b558594b4 100644 (file)
@@ -1595,13 +1595,7 @@ static void iomap_dio_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);
        }
 }