[5/9] iomap: use bio_release_pages in iomap_dio_bio_end_io
diff mbox series

Message ID 20190626134928.7988-6-hch@lst.de
State New
Headers show
Series
  • [1/9] block: move the BIO_NO_PAGE_REF check into bio_release_pages
Related show

Commit Message

Christoph Hellwig June 26, 2019, 1:49 p.m. UTC
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(-)

Comments

Minwoo Im June 26, 2019, 8:42 p.m. UTC | #1
This looks good to me.

Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Chaitanya Kulkarni June 26, 2019, 8:47 p.m. UTC | #2
Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

On 06/26/2019 06:50 AM, Christoph Hellwig wrote:
> 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(-)
>
> diff --git a/fs/iomap.c b/fs/iomap.c
> index 23ef63fd1669..3798eaf789d7 100644
> --- a/fs/iomap.c
> +++ b/fs/iomap.c
> @@ -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);
>   	}
>   }
>

Patch
diff mbox series

diff --git a/fs/iomap.c b/fs/iomap.c
index 23ef63fd1669..3798eaf789d7 100644
--- a/fs/iomap.c
+++ b/fs/iomap.c
@@ -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);
 	}
 }