diff options
| author | Jens Axboe <axboe@kernel.dk> | 2025-04-04 14:50:59 -0600 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-04-21 05:06:58 -0600 |
| commit | 53db8a71ecb42c2ec5e9c6925269a750255f9af5 (patch) | |
| tree | 5feb2d598e3069028de9348d593aa02d303358b6 /io_uring/opdef.c | |
| parent | bd32923e5f02fa7b04d487ec265dc8080d27a257 (diff) | |
io_uring: add support for IORING_OP_PIPE
This works just like pipe2(2), except it also supports fixed file
descriptors. Used in a similar fashion as for other fd instantiating
opcodes (like accept, socket, open, etc), where sqe->file_slot is set
appropriately if two direct descriptors are desired rather than a set
of normal file descriptors.
sqe->addr must be set to a pointer to an array of 2 integers, which
is where the fixed/normal file descriptors are copied to.
sqe->pipe_flags contains flags, same as what is allowed for pipe2(2).
Future expansion of per-op private flags can go in sqe->ioprio,
like we do for other opcodes that take both a "syscall" flag set and
an io_uring opcode specific flag set.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/opdef.c')
| -rw-r--r-- | io_uring/opdef.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/io_uring/opdef.c b/io_uring/opdef.c index 489384c0438b..db36433c2294 100644 --- a/io_uring/opdef.c +++ b/io_uring/opdef.c @@ -569,6 +569,10 @@ const struct io_issue_def io_issue_defs[] = { .prep = io_prep_writev_fixed, .issue = io_write, }, + [IORING_OP_PIPE] = { + .prep = io_pipe_prep, + .issue = io_pipe, + }, }; const struct io_cold_def io_cold_defs[] = { @@ -815,6 +819,9 @@ const struct io_cold_def io_cold_defs[] = { .cleanup = io_readv_writev_cleanup, .fail = io_rw_fail, }, + [IORING_OP_PIPE] = { + .name = "PIPE", + }, }; const char *io_uring_get_opcode(u8 opcode) |
