io_uring: get rid of intermediate IORING_OP_CLOSE stage
authorJens Axboe <axboe@kernel.dk>
Tue, 19 Jan 2021 22:50:37 +0000 (15:50 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Jan 2021 15:18:37 +0000 (08:18 -0700)
commit729ebe1a01e23960a106f493d30d47da0edaa23f
tree2530ace5a740362a9a504d088b95066dde26a5a1
parent1633582bcdf155039deb6ab37a8008ab39f8fb2c
io_uring: get rid of intermediate IORING_OP_CLOSE stage

We currently split the close into two, in case we have a ->flush op
that we can't safely handle from non-blocking context. This requires
us to flag the op as uncancelable if we do need to punt it async, and
that means special handling for just this op type.

Use __close_fd_get_file() and grab the files lock so we can get the file
and check if we need to go async in one atomic operation. That gets rid
of the need for splitting this into two steps, and hence the need for
IO_WQ_WORK_NO_CANCEL.

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