[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230525214822.2725616-4-kent.overstreet@linux.dev>
Date: Thu, 25 May 2023 17:48:18 -0400
From: Kent Overstreet <kent.overstreet@...ux.dev>
To: linux-kernel@...r.kernel.org, axboe@...nel.dk
Cc: Kent Overstreet <kent.overstreet@...il.com>,
linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
Kent Overstreet <kent.overstreet@...ux.dev>
Subject: [PATCH 3/7] block: Bring back zero_fill_bio_iter
From: Kent Overstreet <kent.overstreet@...il.com>
This reverts the commit that deleted it; it's used by bcachefs.
Signed-off-by: Kent Overstreet <kent.overstreet@...ux.dev>
Cc: Jens Axboe <axboe@...nel.dk>
Cc: linux-block@...r.kernel.org
---
block/bio.c | 6 +++---
include/linux/bio.h | 7 ++++++-
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/block/bio.c b/block/bio.c
index e74a04ea14..70b5c987bc 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -606,15 +606,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 d766be7152..3536f28c05 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -484,7 +484,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)
{
--
2.40.1
Powered by blists - more mailing lists