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/waitid: 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/waitid.c
··· 132 132 io_req_set_res(req, ret, 0); 133 133 } 134 134 135 - static bool __io_waitid_cancel(struct io_ring_ctx *ctx, struct io_kiocb *req) 135 + static bool __io_waitid_cancel(struct io_kiocb *req) 136 136 { 137 137 struct io_waitid *iw = io_kiocb_to_cmd(req, struct io_waitid); 138 138 struct io_waitid_async *iwa = req->async_data; ··· 170 170 if (req->cqe.user_data != cd->data && 171 171 !(cd->flags & IORING_ASYNC_CANCEL_ANY)) 172 172 continue; 173 - if (__io_waitid_cancel(ctx, req)) 173 + if (__io_waitid_cancel(req)) 174 174 nr++; 175 175 if (!(cd->flags & IORING_ASYNC_CANCEL_ALL)) 176 176 break; ··· 186 186 bool io_waitid_remove_all(struct io_ring_ctx *ctx, struct io_uring_task *tctx, 187 187 bool cancel_all) 188 188 { 189 - struct hlist_node *tmp; 190 - struct io_kiocb *req; 191 - bool found = false; 192 - 193 - lockdep_assert_held(&ctx->uring_lock); 194 - 195 - hlist_for_each_entry_safe(req, tmp, &ctx->waitid_list, hash_node) { 196 - if (!io_match_task_safe(req, tctx, cancel_all)) 197 - continue; 198 - hlist_del_init(&req->hash_node); 199 - __io_waitid_cancel(ctx, req); 200 - found = true; 201 - } 202 - 203 - return found; 189 + return io_cancel_remove_all(ctx, tctx, &ctx->waitid_list, cancel_all, __io_waitid_cancel); 204 190 } 205 191 206 192 static inline bool io_waitid_drop_issue_ref(struct io_kiocb *req)