diff options
| author | Christoph Hellwig <hch@lst.de> | 2026-04-07 16:05:26 +0200 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-04-07 08:22:24 -0600 |
| commit | 6fa747550e35f0a74e649b19d97055988a25b2e4 (patch) | |
| tree | 6a09feb5565fad13def838ad33bae139b6881bff /include/linux | |
| parent | 65565ca5f99b42fe62b9a10117cca04f4311dc66 (diff) | |
block: factor out a bio_await helper
Add a new helper to wait for a bio and anything chained off it to
complete synchronously after submitting it. This factors common code out
of submit_bio_wait and bio_await_chain and will also be useful for
file system code and thus is exported.
Note that this will now set REQ_SYNC also for the bio_await case for
consistency. Nothing should look at the flag in the end_io handler,
but if something does having the flag set makes more sense.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://patch.msgid.link/20260407140538.633364-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bio.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/bio.h b/include/linux/bio.h index 984844d2870b..97d747320b35 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -432,6 +432,8 @@ extern void bio_uninit(struct bio *); void bio_reset(struct bio *bio, struct block_device *bdev, blk_opf_t opf); void bio_reuse(struct bio *bio, blk_opf_t opf); void bio_chain(struct bio *, struct bio *); +void bio_await(struct bio *bio, void *priv, + void (*submit)(struct bio *bio, void *priv)); int __must_check bio_add_page(struct bio *bio, struct page *page, unsigned len, unsigned off); |
