]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
io_uring/query: return number of available queries
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 10 Nov 2025 13:03:53 +0000 (13:03 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 10 Nov 2025 21:59:35 +0000 (14:59 -0700)
It's useful to know which query opcodes are available. Extend the
structure and return that. It's a trivial change, and even though it can
be painlessly extended later, it'd still require adding a v2 of the
structure.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/uapi/linux/io_uring/query.h
io_uring/query.c

index 5d754322a27c80a532457d208b976f6e4dbb239f..3539ccbfd0644ce1a0b289513510e6584d1784a2 100644 (file)
@@ -36,6 +36,9 @@ struct io_uring_query_opcode {
        __u64   enter_flags;
        /* Bitmask of all supported IOSQE_* flags */
        __u64   sqe_flags;
+       /* The number of available query opcodes */
+       __u32   nr_query_opcodes;
+       __u32   __pad;
 };
 
 #endif
index 645301bd2c8293184b77aa0d357c525d65c6462f..cf02893ba911b6051b9a91c924e934740b4d45f6 100644 (file)
@@ -20,6 +20,8 @@ static ssize_t io_query_ops(void *data)
        e->ring_setup_flags = IORING_SETUP_FLAGS;
        e->enter_flags = IORING_ENTER_FLAGS;
        e->sqe_flags = SQE_VALID_FLAGS;
+       e->nr_query_opcodes = __IO_URING_QUERY_MAX;
+       e->__pad = 0;
        return sizeof(*e);
 }