]> git.ipfire.org Git - thirdparty/linux.git/commit
selftests: ublk: add support for user copy to kublk
authorCaleb Sander Mateos <csander@purestorage.com>
Fri, 12 Dec 2025 17:17:06 +0000 (10:17 -0700)
committerJens Axboe <axboe@kernel.dk>
Fri, 12 Dec 2025 19:50:41 +0000 (12:50 -0700)
commitb9f0a94c3b2e7deaff93e4c4de335e3054223ff4
tree629b1309237da7b6786e836b7f42f6c0cb5d5c5c
parent52bc483763262b66e51818a82e03cad0c5bfef67
selftests: ublk: add support for user copy to kublk

The ublk selftests mock ublk server kublk supports every data copy mode
except user copy. Add support for user copy to kublk, enabled via the
--user_copy (-u) command line argument. On writes, issue pread() calls
to copy the write data into the ublk_io's buffer before dispatching the
write to the target implementation. On reads, issue pwrite() calls to
copy read data from the ublk_io's buffer before committing the request.
Copy in 2 KB chunks to provide some coverage of the offseting logic.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
tools/testing/selftests/ublk/file_backed.c
tools/testing/selftests/ublk/kublk.c
tools/testing/selftests/ublk/kublk.h
tools/testing/selftests/ublk/stripe.c