Message ID | 20190502233332.28720-5-hch@lst.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/8] block: move the BIO_NO_PAGE_REF check into bio_release_pages | expand |
On Thu, May 02, 2019 at 07:33:28PM -0400, Christoph Hellwig wrote: > @@ -1588,13 +1588,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); Shouldn't this rather be: if (!bio_flagged(bio, BIO_NO_PAGE_REF)) bio_release_pages(bio);
On Sat, May 04, 2019 at 02:33:09PM +0200, Johannes Thumshirn wrote: > > Shouldn't this rather be: > > if (!bio_flagged(bio, BIO_NO_PAGE_REF)) > bio_release_pages(bio); OK I apparently can't remember between 3 emails, sorry Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
diff --git a/fs/iomap.c b/fs/iomap.c index 12a656271076..a7bff5b2e1e8 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -1588,13 +1588,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); bio_put(bio); } }
Use bio_release_pages instead of duplicating it. Signed-off-by: Christoph Hellwig <hch@lst.de> --- fs/iomap.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)