Commit 6a77267d authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe
Browse files

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: default avatarPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent d3c9c213
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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);
}