io_uring: add support for IORING_OP_CLOSE

This works just like close(2), unsurprisingly. We remove the file
descriptor and post the completion inline, then offload the actual
(potential) last file put to async context.

Mark the async part of this work as uncancellable, as we really must
guarantee that the latter part of the close is run.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe
2019-12-11 14:02:38 -07:00
parent 0c9d5ccd26
commit b5dba59e0c
2 changed files with 110 additions and 0 deletions

View File

@@ -79,6 +79,7 @@ enum {
IORING_OP_CONNECT,
IORING_OP_FALLOCATE,
IORING_OP_OPENAT,
IORING_OP_CLOSE,
/* this goes last, obviously */
IORING_OP_LAST,