diff mbox series

[1/2] block: remove zero_fill_bio_iter

Message ID 20210412134658.2623190-1-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/2] block: remove zero_fill_bio_iter | expand

Commit Message

Christoph Hellwig April 12, 2021, 1:46 p.m. UTC
zero_fill_bio_iter is only used to implement zero_fill_bio, so
remove the indirection.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/bio.c         | 6 +++---
 include/linux/bio.h | 7 +------
 2 files changed, 4 insertions(+), 9 deletions(-)

Comments

Johannes Thumshirn April 12, 2021, 1:51 p.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Jens Axboe April 12, 2021, 3:20 p.m. UTC | #2
On 4/12/21 7:46 AM, Christoph Hellwig wrote:
> zero_fill_bio_iter is only used to implement zero_fill_bio, so
> remove the indirection.

Applied 1-2, thanks.
diff mbox series

Patch

diff --git a/block/bio.c b/block/bio.c
index 26b7f721cda88b..0fecb80872c23f 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -493,20 +493,20 @@  struct bio *bio_kmalloc(gfp_t gfp_mask, unsigned short nr_iovecs)
 }
 EXPORT_SYMBOL(bio_kmalloc);
 
-void zero_fill_bio_iter(struct bio *bio, struct bvec_iter start)
+void zero_fill_bio(struct bio *bio)
 {
 	unsigned long flags;
 	struct bio_vec bv;
 	struct bvec_iter iter;
 
-	__bio_for_each_segment(bv, bio, iter, start) {
+	bio_for_each_segment(bv, bio, iter) {
 		char *data = bvec_kmap_irq(&bv, &flags);
 		memset(data, 0, bv.bv_len);
 		flush_dcache_page(bv.bv_page);
 		bvec_kunmap_irq(data, &flags);
 	}
 }
-EXPORT_SYMBOL(zero_fill_bio_iter);
+EXPORT_SYMBOL(zero_fill_bio);
 
 /**
  * bio_truncate - truncate the bio to small size of @new_size
diff --git a/include/linux/bio.h b/include/linux/bio.h
index d0246c92a6e865..a8021d79d45d1f 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -485,14 +485,9 @@  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_list_copy_data(struct bio *dst, struct bio *src);
 extern void bio_free_pages(struct bio *bio);
-void zero_fill_bio_iter(struct bio *bio, struct bvec_iter iter);
 void bio_truncate(struct bio *bio, unsigned new_size);
 void guard_bio_eod(struct bio *bio);
-
-static inline void zero_fill_bio(struct bio *bio)
-{
-	zero_fill_bio_iter(bio, bio->bi_iter);
-}
+void zero_fill_bio(struct bio *bio);
 
 extern const char *bio_devname(struct bio *bio, char *buffer);