All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET v2 0/6] Support selectable file descriptors
@ 2020-03-04 18:00 Jens Axboe
  2020-03-04 18:00 ` [PATCH 1/6] fs: openat2: Extend open_how to allow userspace-selected fds Jens Axboe
                   ` (7 more replies)
  0 siblings, 8 replies; 19+ messages in thread
From: Jens Axboe @ 2020-03-04 18:00 UTC (permalink / raw)
  To: io-uring; +Cc: jlayton, josh

One of the fabled features with chains has long been the desire to
support things like:

<open fileX><read from fileX><close fileX>

in a single chain. This currently doesn't work, since the read/close
depends on what file descriptor we get on open.

The original attempt at solving this provided a means to pass
descriptors between chains in a link, this version takes a different
route. Based on Josh's support for O_SPECIFIC_FD, we can instead control
what fd value we're going to get out of open (or accept). With that in
place, we don't need to do any magic to make this work. The above chain
then becomes:

<open fileX with fd Y><read from fd Y><close fd Y>

which is a lot more useful, and allows any sort of weird chains without
needing to nest "last open" file descriptors.

Updated the test program to use this approach:

https://git.kernel.dk/cgit/liburing/plain/test/orc.c?h=fd-select

which forces the use of fd==89 for the open, and then uses that for the
read and close.

Outside of this adaptation, fixed a few bugs and cleaned things up.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-03-09 20:33 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-04 18:00 [PATCHSET v2 0/6] Support selectable file descriptors Jens Axboe
2020-03-04 18:00 ` [PATCH 1/6] fs: openat2: Extend open_how to allow userspace-selected fds Jens Axboe
2020-03-04 18:00 ` [PATCH 2/6] io_uring: move CLOSE req->file checking into handler Jens Axboe
2020-03-04 18:00 ` [PATCH 3/6] io_uring: move read/write side file based prep into op handler Jens Axboe
2020-03-04 18:00 ` [PATCH 4/6] io_uring: support deferred retrival of file from fd Jens Axboe
2020-03-04 18:00 ` [PATCH 5/6] net: allow specific fd selection for __sys_accept4_file() Jens Axboe
2020-03-04 18:00 ` [PATCH 6/6] io_uring: allow specific fd for IORING_OP_ACCEPT Jens Axboe
2020-03-04 19:02   ` Josh Triplett
2020-03-04 19:09     ` Jens Axboe
2020-03-04 19:51       ` Josh Triplett
2020-03-04 19:03 ` [PATCHSET v2 0/6] Support selectable file descriptors Josh Triplett
2020-03-04 19:10   ` Jens Axboe
2020-03-04 19:28     ` Jeff Layton
2020-03-04 19:50       ` Jens Axboe
2020-03-04 19:56     ` Josh Triplett
2020-03-04 20:00       ` Jens Axboe
2020-03-04 20:09         ` Josh Triplett
2020-03-04 20:14           ` Jens Axboe
2020-03-09 20:33 ` Stefan Metzmacher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.