Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: unify the synchronous bi_end_io callbacks

Put the bio in bio_await_chain after waiting for the completion, and
share the now identical callbacks between submit_bio_wait and
bio_await_chain.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://patch.msgid.link/20260407140538.633364-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Hellwig and committed by
Jens Axboe
65565ca5 452c8f6c

+3 -8
+3 -8
block/bio.c
··· 1462 1462 bio_iov_iter_unbounce_read(bio, is_error, mark_dirty); 1463 1463 } 1464 1464 1465 - static void submit_bio_wait_endio(struct bio *bio) 1465 + static void bio_wait_end_io(struct bio *bio) 1466 1466 { 1467 1467 complete(bio->bi_private); 1468 1468 } ··· 1484 1484 bio->bi_bdev->bd_disk->lockdep_map); 1485 1485 1486 1486 bio->bi_private = &done; 1487 - bio->bi_end_io = submit_bio_wait_endio; 1487 + bio->bi_end_io = bio_wait_end_io; 1488 1488 bio->bi_opf |= REQ_SYNC; 1489 1489 submit_bio(bio); 1490 1490 blk_wait_io(&done); ··· 1523 1523 } 1524 1524 EXPORT_SYMBOL_GPL(bdev_rw_virt); 1525 1525 1526 - static void bio_wait_end_io(struct bio *bio) 1527 - { 1528 - complete(bio->bi_private); 1529 - bio_put(bio); 1530 - } 1531 - 1532 1526 /* 1533 1527 * bio_await_chain - ends @bio and waits for every chained bio to complete 1534 1528 */ ··· 1535 1541 bio->bi_end_io = bio_wait_end_io; 1536 1542 bio_endio(bio); 1537 1543 blk_wait_io(&done); 1544 + bio_put(bio); 1538 1545 } 1539 1546 1540 1547 void __bio_advance(struct bio *bio, unsigned bytes)