io_uring: add support for IORING_OP_PIPE io_uring-pipe
authorJens Axboe <axboe@kernel.dk>
Fri, 4 Apr 2025 20:50:59 +0000 (14:50 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 4 Apr 2025 20:50:59 +0000 (14:50 -0600)
commitba930b7521b3a3441c5bd75ce5abe841abc3dbb7
treec82b1e4e11a5e0ea1b0c8e1a3ebeb718762de1cc
parent958433296bbcbb0031f37dbf5b7e7ee41c21c97b
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>
include/uapi/linux/io_uring.h
io_uring/opdef.c
io_uring/openclose.c
io_uring/openclose.h