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: retain top 8bits of uring_cmd flags for kernel internal use

Retain top 8bits of uring_cmd flags for kernel internal use, so that we
can move IORING_URING_CMD_POLLED out of uapi header.

Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Ming Lei and committed by
Jens Axboe
528ce678 f31ecf67

+9 -4
+3
include/linux/io_uring.h
··· 22 22 IO_URING_F_IOPOLL = (1 << 10), 23 23 }; 24 24 25 + /* only top 8 bits of sqe->uring_cmd_flags for kernel internal use */ 26 + #define IORING_URING_CMD_POLLED (1U << 31) 27 + 25 28 struct io_uring_cmd { 26 29 struct file *file; 27 30 const struct io_uring_sqe *sqe;
+2 -3
include/uapi/linux/io_uring.h
··· 249 249 }; 250 250 251 251 /* 252 - * sqe->uring_cmd_flags 252 + * sqe->uring_cmd_flags top 8bits aren't available for userspace 253 253 * IORING_URING_CMD_FIXED use registered buffer; pass this flag 254 254 * along with setting sqe->buf_index. 255 - * IORING_URING_CMD_POLLED driver use only 256 255 */ 257 256 #define IORING_URING_CMD_FIXED (1U << 0) 258 - #define IORING_URING_CMD_POLLED (1U << 31) 257 + #define IORING_URING_CMD_MASK IORING_URING_CMD_FIXED 259 258 260 259 261 260 /*
+3
io_uring/io_uring.c
··· 4669 4669 4670 4670 BUILD_BUG_ON(sizeof(atomic_t) != sizeof(u32)); 4671 4671 4672 + /* top 8bits are for internal use */ 4673 + BUILD_BUG_ON((IORING_URING_CMD_MASK & 0xff000000) != 0); 4674 + 4672 4675 io_uring_optable_init(); 4673 4676 4674 4677 /*
+1 -1
io_uring/uring_cmd.c
··· 91 91 return -EINVAL; 92 92 93 93 ioucmd->flags = READ_ONCE(sqe->uring_cmd_flags); 94 - if (ioucmd->flags & ~IORING_URING_CMD_FIXED) 94 + if (ioucmd->flags & ~IORING_URING_CMD_MASK) 95 95 return -EINVAL; 96 96 97 97 if (ioucmd->flags & IORING_URING_CMD_FIXED) {