summaryrefslogtreecommitdiff
path: root/io_uring/opdef.c
diff options
context:
space:
mode:
authorGabriel Krisman Bertazi <krisman@suse.de>2024-06-18 22:06:18 -0400
committerJens Axboe <axboe@kernel.dk>2024-06-19 08:58:00 -0600
commit3e05b222382ec67dce7358d50b6006e91d028d8b (patch)
tree98673677d3b3af8c7cdd754fde7c11fd70c69155 /io_uring/opdef.c
parentff140cc8628abfb1755691d16cfa8788d8820ef7 (diff)
io_uring: Fix probe of disabled operations
io_probe checks io_issue_def->not_supported, but we never really set that field, as we mark non-supported functions through a specific ->prep handler. This means we end up returning IO_URING_OP_SUPPORTED, even for disabled operations. Fix it by just checking the prep handler itself. Fixes: 66f4af93da57 ("io_uring: add support for probing opcodes") Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de> Link: https://lore.kernel.org/r/20240619020620.5301-2-krisman@suse.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/opdef.c')
-rw-r--r--io_uring/opdef.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/io_uring/opdef.c b/io_uring/opdef.c
index 2dd49cf22f64..a2be3bbca5ff 100644
--- a/io_uring/opdef.c
+++ b/io_uring/opdef.c
@@ -751,6 +751,14 @@ const char *io_uring_get_opcode(u8 opcode)
return "INVALID";
}
+bool io_uring_op_supported(u8 opcode)
+{
+ if (opcode < IORING_OP_LAST &&
+ io_issue_defs[opcode].prep != io_eopnotsupp_prep)
+ return true;
+ return false;
+}
+
void __init io_uring_optable_init(void)
{
int i;