diff mbox series

[05/26] block: Allow using bio_attempt_back_merge() internally

Message ID 20240202073104.2418230-6-dlemoal@kernel.org (mailing list archive)
State Not Applicable, archived
Delegated to: Mike Snitzer
Headers show
Series Zone write plugging | expand

Commit Message

Damien Le Moal Feb. 2, 2024, 7:30 a.m. UTC
Remove the static definition of bio_attempt_back_merge() to allow using
this function internally from other block layer files. Add the
definition of enum bio_merge_status and the declaration of
bio_attempt_back_merge() to block/blk.h.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
 block/blk-merge.c | 8 +-------
 block/blk.h       | 8 ++++++++
 2 files changed, 9 insertions(+), 7 deletions(-)

Comments

Bart Van Assche Feb. 3, 2024, 4:11 a.m. UTC | #1
On 2/1/24 23:30, Damien Le Moal wrote:
> Remove the static definition of bio_attempt_back_merge() to allow using
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To me this suggests that the function definition is removed entirely but
that is not what this patch does ...

Otherwise this patch looks good to me.

Thanks,

Bart.
Hannes Reinecke Feb. 4, 2024, noon UTC | #2
On 2/2/24 15:30, Damien Le Moal wrote:
> Remove the static definition of bio_attempt_back_merge() to allow using
> this function internally from other block layer files. Add the
> definition of enum bio_merge_status and the declaration of
> bio_attempt_back_merge() to block/blk.h.
> 
> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
> ---
>   block/blk-merge.c | 8 +-------
>   block/blk.h       | 8 ++++++++
>   2 files changed, 9 insertions(+), 7 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
diff mbox series

Patch

diff --git a/block/blk-merge.c b/block/blk-merge.c
index 2d470cf2173e..a1ef61b03e31 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -964,13 +964,7 @@  static void blk_account_io_merge_bio(struct request *req)
 	part_stat_unlock();
 }
 
-enum bio_merge_status {
-	BIO_MERGE_OK,
-	BIO_MERGE_NONE,
-	BIO_MERGE_FAILED,
-};
-
-static enum bio_merge_status bio_attempt_back_merge(struct request *req,
+enum bio_merge_status bio_attempt_back_merge(struct request *req,
 		struct bio *bio, unsigned int nr_segs)
 {
 	const blk_opf_t ff = bio_failfast(bio);
diff --git a/block/blk.h b/block/blk.h
index 23f76b452e70..5180e103ed9c 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -256,6 +256,14 @@  static inline void bio_integrity_free(struct bio *bio)
 unsigned long blk_rq_timeout(unsigned long timeout);
 void blk_add_timer(struct request *req);
 
+enum bio_merge_status {
+	BIO_MERGE_OK,
+	BIO_MERGE_NONE,
+	BIO_MERGE_FAILED,
+};
+
+enum bio_merge_status bio_attempt_back_merge(struct request *req,
+		struct bio *bio, unsigned int nr_segs);
 bool blk_attempt_plug_merge(struct request_queue *q, struct bio *bio,
 		unsigned int nr_segs);
 bool blk_bio_list_merge(struct request_queue *q, struct list_head *list,