io_uring/cmd: give inline space in request to cmds
ANBZ: #13597
commit a6ccb48e13
upstream.
Some io_uring commands can use some inline space in io_kiocb. We have 32
bytes in struct io_uring_cmd, expose it.
[Fix conflict]
no include/linux/io_uring/cmd.h, move it into io_uring.h
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>
Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com>
Reviewed-by: Guixin Liu <kanie@linux.alibaba.com>
Link: https://gitee.com/anolis/cloud-kernel/pulls/4523
This commit is contained in:
parent
1293141009
commit
af87139652
|
@ -30,6 +30,15 @@ struct io_uring_cmd {
|
|||
u8 pdu[32]; /* available inline for free use */
|
||||
};
|
||||
|
||||
static inline void io_uring_cmd_private_sz_check(size_t cmd_sz)
|
||||
{
|
||||
BUILD_BUG_ON(cmd_sz > sizeof_field(struct io_uring_cmd, pdu));
|
||||
}
|
||||
#define io_uring_cmd_to_pdu(cmd, pdu_type) ( \
|
||||
io_uring_cmd_private_sz_check(sizeof(pdu_type)), \
|
||||
((pdu_type *)&(cmd)->pdu) \
|
||||
)
|
||||
|
||||
#if defined(CONFIG_IO_URING)
|
||||
void io_uring_cmd_done(struct io_uring_cmd *cmd, ssize_t ret, ssize_t res2);
|
||||
void io_uring_cmd_complete_in_task(struct io_uring_cmd *ioucmd,
|
||||
|
|
Loading…
Reference in New Issue