summaryrefslogtreecommitdiffstats
path: root/io_uring
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2023-09-28 20:43:24 +0800
committerJens Axboe <axboe@kernel.dk>2023-09-28 07:31:41 -0600
commit528ce6781726e022bc5dc84034360e6e8f1b89bd (patch)
treed5ce523f21f89ab280f2371bbc745cdf8ea8bc52 /io_uring
parentf31ecf671ddc498f20219453395794ff2383e06b (diff)
downloadlinux-528ce6781726e022bc5dc84034360e6e8f1b89bd.tar.gz
linux-528ce6781726e022bc5dc84034360e6e8f1b89bd.tar.bz2
linux-528ce6781726e022bc5dc84034360e6e8f1b89bd.zip
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>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/io_uring.c3
-rw-r--r--io_uring/uring_cmd.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 2dff4772bf14..cb6bd9907045 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -4669,6 +4669,9 @@ static int __init io_uring_init(void)
BUILD_BUG_ON(sizeof(atomic_t) != sizeof(u32));
+ /* top 8bits are for internal use */
+ BUILD_BUG_ON((IORING_URING_CMD_MASK & 0xff000000) != 0);
+
io_uring_optable_init();
/*
diff --git a/io_uring/uring_cmd.c b/io_uring/uring_cmd.c
index 537795fddc87..a0b0ec5473bf 100644
--- a/io_uring/uring_cmd.c
+++ b/io_uring/uring_cmd.c
@@ -91,7 +91,7 @@ int io_uring_cmd_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
return -EINVAL;
ioucmd->flags = READ_ONCE(sqe->uring_cmd_flags);
- if (ioucmd->flags & ~IORING_URING_CMD_FIXED)
+ if (ioucmd->flags & ~IORING_URING_CMD_MASK)
return -EINVAL;
if (ioucmd->flags & IORING_URING_CMD_FIXED) {