Skip to content

Commit 6a77267

Browse files
isilenceaxboe
authored andcommitted
io_uring/query: return number of available queries
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 <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent d3c9c21 commit 6a77267

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

include/uapi/linux/io_uring/query.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ struct io_uring_query_opcode {
3636
__u64 enter_flags;
3737
/* Bitmask of all supported IOSQE_* flags */
3838
__u64 sqe_flags;
39+
/* The number of available query opcodes */
40+
__u32 nr_query_opcodes;
41+
__u32 __pad;
3942
};
4043

4144
#endif

io_uring/query.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ static ssize_t io_query_ops(void *data)
2020
e->ring_setup_flags = IORING_SETUP_FLAGS;
2121
e->enter_flags = IORING_ENTER_FLAGS;
2222
e->sqe_flags = SQE_VALID_FLAGS;
23+
e->nr_query_opcodes = __IO_URING_QUERY_MAX;
24+
e->__pad = 0;
2325
return sizeof(*e);
2426
}
2527

0 commit comments

Comments
 (0)