OSDN Git Service

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, 1 Feb 2021 17:02:43 +0000 (10:02 -0700)
commit9eac1904d3364254d622bf2c771c4f85cd435fc2
tree0430f5c8591c27fa6aae45318975888de70e7543
parent53dec2ea74f2ef360e8455439be96a780baa6097
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