Commit 649f070e authored by Kent Overstreet's avatar Kent Overstreet Committed by Jens Axboe

block: Bring back zero_fill_bio_iter

This reverts 6f822e1b - this helper is
used by bcachefs.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
Link: https://lore.kernel.org/r/20230813182636.2966159-4-kent.overstreet@linux.devSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 168145f6
...@@ -606,15 +606,15 @@ struct bio *bio_kmalloc(unsigned short nr_vecs, gfp_t gfp_mask) ...@@ -606,15 +606,15 @@ struct bio *bio_kmalloc(unsigned short nr_vecs, gfp_t gfp_mask)
} }
EXPORT_SYMBOL(bio_kmalloc); 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 bio_vec bv;
struct bvec_iter iter; struct bvec_iter iter;
bio_for_each_segment(bv, bio, iter) __bio_for_each_segment(bv, bio, iter, start)
memzero_bvec(&bv); 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 * bio_truncate - truncate the bio to small size of @new_size
......
...@@ -488,7 +488,12 @@ extern void bio_copy_data_iter(struct bio *dst, struct bvec_iter *dst_iter, ...@@ -488,7 +488,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_copy_data(struct bio *dst, struct bio *src);
extern void bio_free_pages(struct bio *bio); extern void bio_free_pages(struct bio *bio);
void guard_bio_eod(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) static inline void bio_release_pages(struct bio *bio, bool mark_dirty)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment