Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/futex: convert to io_cancel_remove_all()

Use the generic helper for cancelations.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

+3 -17
+3 -17
io_uring/futex.c
··· 90 90 return true; 91 91 } 92 92 93 - static bool __io_futex_cancel(struct io_ring_ctx *ctx, struct io_kiocb *req) 93 + static bool __io_futex_cancel(struct io_kiocb *req) 94 94 { 95 95 /* futex wake already done or in progress */ 96 96 if (req->opcode == IORING_OP_FUTEX_WAIT) { ··· 128 128 if (req->cqe.user_data != cd->data && 129 129 !(cd->flags & IORING_ASYNC_CANCEL_ANY)) 130 130 continue; 131 - if (__io_futex_cancel(ctx, req)) 131 + if (__io_futex_cancel(req)) 132 132 nr++; 133 133 if (!(cd->flags & IORING_ASYNC_CANCEL_ALL)) 134 134 break; ··· 144 144 bool io_futex_remove_all(struct io_ring_ctx *ctx, struct io_uring_task *tctx, 145 145 bool cancel_all) 146 146 { 147 - struct hlist_node *tmp; 148 - struct io_kiocb *req; 149 - bool found = false; 150 - 151 - lockdep_assert_held(&ctx->uring_lock); 152 - 153 - hlist_for_each_entry_safe(req, tmp, &ctx->futex_list, hash_node) { 154 - if (!io_match_task_safe(req, tctx, cancel_all)) 155 - continue; 156 - hlist_del_init(&req->hash_node); 157 - __io_futex_cancel(ctx, req); 158 - found = true; 159 - } 160 - 161 - return found; 147 + return io_cancel_remove_all(ctx, tctx, &ctx->futex_list, cancel_all, __io_futex_cancel); 162 148 } 163 149 164 150 int io_futex_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)