summaryrefslogtreecommitdiff
path: root/io_uring/opdef.c
diff options
context:
space:
mode:
authorGabriel Krisman Bertazi <krisman@suse.de>2024-06-14 12:30:46 -0400
committerJens Axboe <axboe@kernel.dk>2024-06-19 07:57:21 -0600
commit7481fd93fa0a851740e26026485f56a1305454ce (patch)
treecbbf8cdfea0b94d6d85371bad17ab38ee2accad5 /io_uring/opdef.c
parentbb6aaf736680f0f3c2e6281735c47c64e2042819 (diff)
io_uring: Introduce IORING_OP_BIND
IORING_OP_BIND provides the semantic of bind(2) via io_uring. While this is an essentially synchronous system call, the main point is to enable a network path to execute fully with io_uring registered and descriptorless files. Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de> Link: https://lore.kernel.org/r/20240614163047.31581-3-krisman@suse.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/opdef.c')
-rw-r--r--io_uring/opdef.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/io_uring/opdef.c b/io_uring/opdef.c
index 2e3b7b16effb..1424c2d9e9ef 100644
--- a/io_uring/opdef.c
+++ b/io_uring/opdef.c
@@ -495,6 +495,16 @@ const struct io_issue_def io_issue_defs[] = {
.prep = io_ftruncate_prep,
.issue = io_ftruncate,
},
+ [IORING_OP_BIND] = {
+#if defined(CONFIG_NET)
+ .needs_file = 1,
+ .prep = io_bind_prep,
+ .issue = io_bind,
+ .async_size = sizeof(struct io_async_msghdr),
+#else
+ .prep = io_eopnotsupp_prep,
+#endif
+ },
};
const struct io_cold_def io_cold_defs[] = {
@@ -716,6 +726,9 @@ const struct io_cold_def io_cold_defs[] = {
[IORING_OP_FTRUNCATE] = {
.name = "FTRUNCATE",
},
+ [IORING_OP_BIND] = {
+ .name = "BIND",
+ },
};
const char *io_uring_get_opcode(u8 opcode)