io_uring/eventfd: move to more idiomatic RCU free usage
authorJens Axboe <axboe@kernel.dk>
Mon, 3 Jun 2024 17:19:10 +0000 (11:19 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 3 Jun 2024 17:40:20 +0000 (11:40 -0600)
commit406bba1293f970d4a0263c2dcb73f80bc496a6be
treee50c268a1e3701fc8643ac4bc381c7fa59145f2f
parenta903dda35f7d61689d45581744e697f146537e75
io_uring/eventfd: move to more idiomatic RCU free usage

In some ways, it just "happens to work" currently with using the ops
field for both the free and signaling bit. But it depends on ordering
of operations in terms of freeing and signaling. Clean it up and use the
usual refs == 0 under RCU read side lock to determine if the ev_fd is
still valid, and use the reference to gate the freeing as well.

Fixes: 21a091b970cd ("io_uring: signal registered eventfd to process deferred task work")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c
io_uring/io_uring.h
io_uring/register.c