Skip to content

Commit 649f070

Browse files
koverstreetaxboe
authored andcommitted
block: Bring back zero_fill_bio_iter
This reverts 6f822e1 - this helper is used by bcachefs. Signed-off-by: Kent Overstreet <[email protected]> Cc: Jens Axboe <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 168145f commit 649f070

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

block/bio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,15 +606,15 @@ struct bio *bio_kmalloc(unsigned short nr_vecs, gfp_t gfp_mask)
606606
}
607607
EXPORT_SYMBOL(bio_kmalloc);
608608

609-
void zero_fill_bio(struct bio *bio)
609+
void zero_fill_bio_iter(struct bio *bio, struct bvec_iter start)
610610
{
611611
struct bio_vec bv;
612612
struct bvec_iter iter;
613613

614-
bio_for_each_segment(bv, bio, iter)
614+
__bio_for_each_segment(bv, bio, iter, start)
615615
memzero_bvec(&bv);
616616
}
617-
EXPORT_SYMBOL(zero_fill_bio);
617+
EXPORT_SYMBOL(zero_fill_bio_iter);
618618

619619
/**
620620
* bio_truncate - truncate the bio to small size of @new_size

include/linux/bio.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,12 @@ extern void bio_copy_data_iter(struct bio *dst, struct bvec_iter *dst_iter,
488488
extern void bio_copy_data(struct bio *dst, struct bio *src);
489489
extern void bio_free_pages(struct bio *bio);
490490
void guard_bio_eod(struct bio *bio);
491-
void zero_fill_bio(struct bio *bio);
491+
void zero_fill_bio_iter(struct bio *bio, struct bvec_iter iter);
492+
493+
static inline void zero_fill_bio(struct bio *bio)
494+
{
495+
zero_fill_bio_iter(bio, bio->bi_iter);
496+
}
492497

493498
static inline void bio_release_pages(struct bio *bio, bool mark_dirty)
494499
{

0 commit comments

Comments
 (0)