In this prep patch we exoprt the __bio_iov_append_get_pages() so that NVMeOF target can use the core logic of building Zone Append bios for REQ_OP_ZONE_APPEND without repeating the code. Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx> --- block/bio.c | 3 ++- include/linux/bio.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/block/bio.c b/block/bio.c index fa01bef35bb1..de356fa28315 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1033,7 +1033,7 @@ static int __bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) return 0; } -static int __bio_iov_append_get_pages(struct bio *bio, struct iov_iter *iter) +int __bio_iov_append_get_pages(struct bio *bio, struct iov_iter *iter) { unsigned short nr_pages = bio->bi_max_vecs - bio->bi_vcnt; unsigned short entries_left = bio->bi_max_vecs - bio->bi_vcnt; @@ -1079,6 +1079,7 @@ static int __bio_iov_append_get_pages(struct bio *bio, struct iov_iter *iter) iov_iter_advance(iter, size - left); return ret; } +EXPORT_SYMBOL_GPL(__bio_iov_append_get_pages); /** * bio_iov_iter_get_pages - add user or kernel pages to a bio diff --git a/include/linux/bio.h b/include/linux/bio.h index c6d765382926..47247c1b0b85 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -446,6 +446,7 @@ bool __bio_try_merge_page(struct bio *bio, struct page *page, unsigned int len, unsigned int off, bool *same_page); void __bio_add_page(struct bio *bio, struct page *page, unsigned int len, unsigned int off); +int __bio_iov_append_get_pages(struct bio *bio, struct iov_iter *iter); int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter); void bio_release_pages(struct bio *bio, bool mark_dirty); extern void bio_set_pages_dirty(struct bio *bio); -- 2.22.1