Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/cmd: give inline space in request to cmds

Some io_uring commands can use some inline space in io_kiocb. We have 32
bytes in struct io_uring_cmd, expose it.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/7ca779a61ee5e166e535d70df9c7f07b15d8a0ce.1726072086.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
a6ccb48e 6746ee4c

+9
+9
include/linux/io_uring/cmd.h
··· 23 23 return sqe->cmd; 24 24 } 25 25 26 + static inline void io_uring_cmd_private_sz_check(size_t cmd_sz) 27 + { 28 + BUILD_BUG_ON(cmd_sz > sizeof_field(struct io_uring_cmd, pdu)); 29 + } 30 + #define io_uring_cmd_to_pdu(cmd, pdu_type) ( \ 31 + io_uring_cmd_private_sz_check(sizeof(pdu_type)), \ 32 + ((pdu_type *)&(cmd)->pdu) \ 33 + ) 34 + 26 35 #if defined(CONFIG_IO_URING) 27 36 int io_uring_cmd_import_fixed(u64 ubuf, unsigned long len, int rw, 28 37 struct iov_iter *iter, void *ioucmd);