diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2021-07-06 12:55:12 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2022-10-03 22:49:31 -0400 |
commit | 85a59cda1e3a209678a1d1411d13945f07a1eb6f (patch) | |
tree | f9fdb9d9b54ba85d66e68cdb4f41bf5f54877a31 | |
parent | 96e9e05ab5df76fa9d3e84a1176989f161ec8ec5 (diff) |
Revert "block: remove zero_fill_bio_iter"
Bring this helper back for bcachefs.
This reverts commit 6f822e1b5d9dda3d20e87365de138046e3baa03a.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r-- | block/bio.c | 6 | ||||
-rw-r--r-- | include/linux/bio.h | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/block/bio.c b/block/bio.c index 9410e11b31cc..ed9a4df9ea36 100644 --- a/block/bio.c +++ b/block/bio.c @@ -582,15 +582,15 @@ struct bio *bio_kmalloc(unsigned short nr_vecs, gfp_t gfp_mask) } EXPORT_SYMBOL(bio_kmalloc); -void zero_fill_bio(struct bio *bio) +void zero_fill_bio_iter(struct bio *bio, struct bvec_iter start) { struct bio_vec bv; struct bvec_iter iter; - bio_for_each_segment(bv, bio, iter) + __bio_for_each_segment(bv, bio, iter, start) memzero_bvec(&bv); } -EXPORT_SYMBOL(zero_fill_bio); +EXPORT_SYMBOL(zero_fill_bio_iter); /** * bio_truncate - truncate the bio to small size of @new_size diff --git a/include/linux/bio.h b/include/linux/bio.h index ca22b06700a9..5692e54eb446 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -480,7 +480,12 @@ extern void bio_copy_data_iter(struct bio *dst, struct bvec_iter *dst_iter, extern void bio_copy_data(struct bio *dst, struct bio *src); extern void bio_free_pages(struct bio *bio); void guard_bio_eod(struct bio *bio); -void zero_fill_bio(struct bio *bio); +void zero_fill_bio_iter(struct bio *bio, struct bvec_iter iter); + +static inline void zero_fill_bio(struct bio *bio) +{ + zero_fill_bio_iter(bio, bio->bi_iter); +} static inline void bio_release_pages(struct bio *bio, bool mark_dirty) { |