refactor submit_bio_wait and bio await helpers v3

Christoph Hellwig
2026-04-07T14:05:43Z

Hi Jens,

this series factors common code between submit_bio_wait and
bio_await_chain into a common helper, and then uses that in XFS
as well instead of open coding such functionality. It also
cleans up the submit or kill logic in the ioctl handlers to
share more code.

There is another places in btrfs that could be refactored to
use this, although it is non-trivial, and I plan to add more
users of this helper to XFS in the future.

Changes since v2:
- spelling fixes
- rename the kick callback to submit

Changes since v1:
- preserve (and extend) setting REQ_SYNC

Diffstat:
block/bio.c | 81 ++++++++++++++++++++++++++++++++-------------------
block/blk-lib.c | 16 +---------
block/blk.h | 2 -
block/ioctl.c | 11 +-----
fs/xfs/xfs_zone_gc.c | 38 +++++++++--------------
include/linux/bio.h | 2 +
6 files changed, 73 insertions(+), 77 deletions(-)