block: bio-integrity: directly map user buffers
authorKeith Busch <kbusch@kernel.org>
Thu, 30 Nov 2023 21:53:06 +0000 (13:53 -0800)
committerJens Axboe <axboe@kernel.dk>
Sat, 2 Dec 2023 01:29:00 +0000 (18:29 -0700)
commit492c5d455969fc2e829f26ed4c83487b068f0dd7
tree534ffa3ff669b48264aaaf87376ab87007947657
parent668bfeeabb5e402e3b36992f7859c284cc6e594d
block: bio-integrity: directly map user buffers

Passthrough commands that utilize metadata currently need to bounce the
user space buffer through the kernel. Add support for mapping user space
directly so that we can avoid this costly overhead. This is similar to
how the normal bio data payload utilizes user addresses with
bio_map_user_iov().

If the user address can't directly be used for reason, like too many
segments or address unalignement, fallback to a copy of the user vec
while keeping the user address pinned for the IO duration so that it
can safely be copied on completion in any process context.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Link: https://lore.kernel.org/r/20231130215309.2923568-2-kbusch@meta.com
[axboe: fold in fix from Kanchan Joshi]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio-integrity.c
include/linux/bio.h