io_uring/mock: add cmd using vectored regbufs

There is a command api allowing to import vectored registered buffers,
add a new mock command that uses the feature and simply copies the
specified registered buffer into user space or vice versa.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/229a113fd7de6b27dbef9567f7c0bf4475c9017d.1750599274.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Pavel Begunkov
2025-06-30 19:16:52 +01:00
committed by Jens Axboe
parent 3a0ae385f6
commit 4aac001f78
2 changed files with 83 additions and 1 deletions

View File

@@ -3,6 +3,12 @@
#include <linux/types.h>
enum {
IORING_MOCK_FEAT_CMD_COPY,
IORING_MOCK_FEAT_END,
};
struct io_uring_mock_probe {
__u64 features;
__u64 __resv[9];
@@ -19,4 +25,12 @@ enum {
IORING_MOCK_MGR_CMD_CREATE,
};
enum {
IORING_MOCK_CMD_COPY_REGBUF,
};
enum {
IORING_MOCK_COPY_FROM = 1,
};
#endif