add more bio helpers v2

Christoph Hellwig
2025-04-30T21:22:05Z

Hi all,

this series adds more block layer helpers to remove boilerplate code when
adding memory to a bio or to even do the entire synchronous I/O.

The main aim is to avoid having to convert to a struct page in the caller
when adding kernel direct mapping or vmalloc memory.

Changes since v1:
- typo fixes
- improve commit messages and kerneldoc comments
- move bio_add_virt_nofail out of line
- make the number of bio_vecs calculation helper more generic
- add another vmalloc helper for the common case

Diffstat:
block/bio.c | 101 +++++++++++++++++++++++++++++++++++++++++
block/blk-map.c | 92 +++++++++----------------------------
drivers/block/pktcdvd.c | 2
drivers/block/rnbd/rnbd-srv.c | 7 --
drivers/block/ublk_drv.c | 3 -
drivers/block/virtio_blk.c | 4 -
drivers/md/bcache/super.c | 3 -
drivers/md/dm-bufio.c | 2
drivers/md/dm-integrity.c | 16 ++----
drivers/nvme/host/core.c | 2
drivers/scsi/scsi_ioctl.c | 2
drivers/scsi/scsi_lib.c | 3 -
fs/btrfs/scrub.c | 10 ----
fs/gfs2/ops_fstype.c | 24 +++------
fs/hfsplus/wrapper.c | 46 +++---------------
fs/xfs/xfs_bio_io.c | 30 ++++--------
fs/xfs/xfs_buf.c | 43 +++--------------
fs/xfs/xfs_log.c | 32 ++-----------
fs/zonefs/super.c | 34 ++++---------
include/linux/bio.h | 25 +++++++++-
include/linux/blk-mq.h | 4 -
kernel/power/swap.c | 103 ++++++++++++++++++------------------------
22 files changed, 270 insertions(+), 318 deletions(-)