OSDN Git Service

io_uring: auto-removal for direct open/accept
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 14 Sep 2021 15:12:52 +0000 (16:12 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 14 Sep 2021 15:50:56 +0000 (09:50 -0600)
commit9c7b0ba887513b6681e7883d306df0a0fd580afa
treef9ec51745eb880d8cd666a1a9d961f14521c831a
parent44df58d441a94de40d52fca67dc60790daee4266
io_uring: auto-removal for direct open/accept

It might be inconvenient that direct open/accept deviates from the
update semantics and fails if the slot is taken instead of removing a
file sitting there. Implement this auto-removal.

Note that removal might need to allocate and so may fail. However, if an
empty slot is specified, it's guaraneed to not fail on the fd
installation side for valid userspace programs. It's needed for users
who can't tolerate such failures, e.g. accept where the other end
never retries.

Suggested-by: Franz-B. Tuneke <franz-bernhard.tuneke@tu-dortmund.de>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/c896f14ea46b0eaa6c09d93149e665c2c37979b4.1631632300.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c