OSDN Git Service

io_uring: add support for marking commands as draining
authorJens Axboe <axboe@kernel.dk>
Sun, 7 Apr 2019 03:51:27 +0000 (21:51 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 2 May 2019 20:08:53 +0000 (14:08 -0600)
commitde0617e467171ba44c73efd1ba63f101b164a035
treef0d4a88d22ee63d0d2270249ed516b4135b92c43
parentea9866793d1e925b4d320eaea409263b2a568f38
io_uring: add support for marking commands as draining

There are no ordering constraints between the submission and completion
side of io_uring. But sometimes that would be useful to have. One common
example is doing an fsync, for instance, and have it ordered with
previous writes. Without support for that, the application must do this
tracking itself.

This adds a general SQE flag, IOSQE_IO_DRAIN. If a command is marked
with this flag, then it will not be issued before previous commands have
completed, and subsequent commands submitted after the drain will not be
issued before the drain is started.. If there are no pending commands,
setting this flag will not change the behavior of the issue of the
command.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
include/uapi/linux/io_uring.h