diff options
author | Christoph Hellwig <hch@lst.de> | 2019-06-26 15:49:28 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-06-29 17:47:32 +0200 |
commit | b620743077e291ae7d0debd21f50413a8c266229 (patch) | |
tree | 965cefe7b283e821cc9f288e9ded8ba0778f6a60 /block | |
parent | direct-io: use bio_release_pages in dio_bio_complete (diff) | |
download | linux-b620743077e291ae7d0debd21f50413a8c266229.tar.xz linux-b620743077e291ae7d0debd21f50413a8c266229.zip |
block: never take page references for ITER_BVEC
If we pass pages through an iov_iter we always already have a reference
in the caller. Thus remove the ITER_BVEC_FLAG_NO_REF and don't take
reference to pages by default for bvec backed iov_iters.
Reviewed-by: Minwoo Im <minwoo.im.dev@gmail.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/bio.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/block/bio.c b/block/bio.c index 1cbf2a7c245e..5733b9426231 100644 --- a/block/bio.c +++ b/block/bio.c @@ -836,15 +836,6 @@ int bio_add_page(struct bio *bio, struct page *page, } EXPORT_SYMBOL(bio_add_page); -static void bio_get_pages(struct bio *bio) -{ - struct bvec_iter_all iter_all; - struct bio_vec *bvec; - - bio_for_each_segment_all(bvec, bio, iter_all) - get_page(bvec->bv_page); -} - void bio_release_pages(struct bio *bio, bool mark_dirty) { struct bvec_iter_all iter_all; @@ -960,11 +951,8 @@ int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) ret = __bio_iov_iter_get_pages(bio, iter); } while (!ret && iov_iter_count(iter) && !bio_full(bio)); - if (iov_iter_bvec_no_ref(iter)) + if (is_bvec) bio_set_flag(bio, BIO_NO_PAGE_REF); - else if (is_bvec) - bio_get_pages(bio); - return bio->bi_vcnt ? 0 : ret; } |