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

io_uring/cmd: Pass compat mode in issue_flags

Create a new flag to track if the operation is running compat mode.
This basically check the context->compat and pass it to the issue_flags,
so, it could be queried later in the callbacks.

Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
Link: https://lore.kernel.org/r/20231016134750.1381153-6-leitao@debian.org
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Breno Leitao and committed by
Jens Axboe
5fea44a6 0b05b0cd

+3
+1
include/linux/io_uring.h
··· 23 23 24 24 /* set when uring wants to cancel a previously issued command */ 25 25 IO_URING_F_CANCEL = (1 << 11), 26 + IO_URING_F_COMPAT = (1 << 12), 26 27 }; 27 28 28 29 /* only top 8 bits of sqe->uring_cmd_flags for kernel internal use */
+2
io_uring/uring_cmd.c
··· 175 175 issue_flags |= IO_URING_F_SQE128; 176 176 if (ctx->flags & IORING_SETUP_CQE32) 177 177 issue_flags |= IO_URING_F_CQE32; 178 + if (ctx->compat) 179 + issue_flags |= IO_URING_F_COMPAT; 178 180 if (ctx->flags & IORING_SETUP_IOPOLL) { 179 181 if (!file->f_op->uring_cmd_iopoll) 180 182 return -EOPNOTSUPP;