io_uring: add support for IORING_OP_PIPE
authorJens Axboe <axboe@kernel.dk>
Fri, 4 Apr 2025 20:50:59 +0000 (14:50 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 21 Apr 2025 11:06:58 +0000 (05:06 -0600)
commit53db8a71ecb42c2ec5e9c6925269a750255f9af5
tree5feb2d598e3069028de9348d593aa02d303358b6
parentbd32923e5f02fa7b04d487ec265dc8080d27a257
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