Skip to content

Commit dd850ff

Browse files
damien-lemoalaxboe
authored andcommitted
block: Allow using bio_attempt_back_merge() internally
Remove "static" from the definition of bio_attempt_back_merge() and declare this function in block/blk.h to allow using it internally from other block layer files. The definition of enum bio_merge_status is also moved to block/blk.h. Signed-off-by: Damien Le Moal <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Tested-by: Hans Holmberg <[email protected]> Tested-by: Dennis Maisenbacher <[email protected]> Reviewed-by: Martin K. Petersen <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent b85a3c1 commit dd850ff

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

block/blk-merge.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -972,13 +972,7 @@ static void blk_account_io_merge_bio(struct request *req)
972972
part_stat_unlock();
973973
}
974974

975-
enum bio_merge_status {
976-
BIO_MERGE_OK,
977-
BIO_MERGE_NONE,
978-
BIO_MERGE_FAILED,
979-
};
980-
981-
static enum bio_merge_status bio_attempt_back_merge(struct request *req,
975+
enum bio_merge_status bio_attempt_back_merge(struct request *req,
982976
struct bio *bio, unsigned int nr_segs)
983977
{
984978
const blk_opf_t ff = bio_failfast(bio);

block/blk.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,14 @@ static inline void bio_integrity_free(struct bio *bio)
269269
unsigned long blk_rq_timeout(unsigned long timeout);
270270
void blk_add_timer(struct request *req);
271271

272+
enum bio_merge_status {
273+
BIO_MERGE_OK,
274+
BIO_MERGE_NONE,
275+
BIO_MERGE_FAILED,
276+
};
277+
278+
enum bio_merge_status bio_attempt_back_merge(struct request *req,
279+
struct bio *bio, unsigned int nr_segs);
272280
bool blk_attempt_plug_merge(struct request_queue *q, struct bio *bio,
273281
unsigned int nr_segs);
274282
bool blk_bio_list_merge(struct request_queue *q, struct list_head *list,

0 commit comments

Comments
 (0)