Lines Matching full:req
28 struct io_kiocb *req;
44 static void __io_futex_complete(struct io_kiocb *req, io_tw_token_t tw)
46 hlist_del_init(&req->hash_node);
47 io_req_task_complete(req, tw);
50 static void io_futex_complete(struct io_kiocb *req, io_tw_token_t tw)
52 struct io_ring_ctx *ctx = req->ctx;
55 io_cache_free(&ctx->futex_cache, req->async_data);
56 io_req_async_data_clear(req, 0);
57 __io_futex_complete(req, tw);
60 static void io_futexv_complete(struct io_kiocb *req, io_tw_token_t tw)
62 struct io_futex *iof = io_kiocb_to_cmd(req, struct io_futex);
63 struct futex_vector *futexv = req->async_data;
65 io_tw_lock(req->ctx, tw);
72 io_req_set_res(req, res, 0);
75 io_req_async_data_free(req);
76 __io_futex_complete(req, tw);
87 static bool __io_futex_cancel(struct io_kiocb *req)
90 if (req->opcode == IORING_OP_FUTEX_WAIT) {
91 struct io_futex_data *ifd = req->async_data;
95 req->io_task_work.func = io_futex_complete;
97 struct io_futex *iof = io_kiocb_to_cmd(req, struct io_futex);
101 req->io_task_work.func = io_futexv_complete;
104 hlist_del_init(&req->hash_node);
105 io_req_set_res(req, -ECANCELED, 0);
106 io_req_task_work_add(req);
122 int io_futex_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
124 struct io_futex *iof = io_kiocb_to_cmd(req, struct io_futex);
148 io_req_track_inflight(req);
154 struct io_kiocb *req = q->wake_data;
155 struct io_futex *iof = io_kiocb_to_cmd(req, struct io_futex);
162 io_req_set_res(req, 0, 0);
163 req->io_task_work.func = io_futexv_complete;
164 io_req_task_work_add(req);
167 int io_futexv_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
169 struct io_futex *iof = io_kiocb_to_cmd(req, struct io_futex);
188 io_futex_wakev_fn, req);
195 io_req_track_inflight(req);
198 req->flags |= REQ_F_ASYNC_DATA;
199 req->async_data = futexv;
206 struct io_kiocb *req = ifd->req;
211 io_req_set_res(req, 0, 0);
212 req->io_task_work.func = io_futex_complete;
213 io_req_task_work_add(req);
216 int io_futexv_wait(struct io_kiocb *req, unsigned int issue_flags)
218 struct io_futex *iof = io_kiocb_to_cmd(req, struct io_futex);
219 struct futex_vector *futexv = req->async_data;
220 struct io_ring_ctx *ctx = req->ctx;
232 req_set_fail(req);
233 io_req_set_res(req, ret, 0);
234 io_req_async_data_free(req);
258 hlist_add_head(&req->hash_node, &ctx->futex_list);
262 io_req_set_res(req, woken, 0);
269 int io_futex_wait(struct io_kiocb *req, unsigned int issue_flags)
271 struct io_futex *iof = io_kiocb_to_cmd(req, struct io_futex);
272 struct io_ring_ctx *ctx = req->ctx;
288 req->flags |= REQ_F_ASYNC_DATA;
289 req->async_data = ifd;
293 ifd->req = req;
298 hlist_add_head(&req->hash_node, &ctx->futex_list);
308 req_set_fail(req);
309 io_req_set_res(req, ret, 0);
310 io_req_async_data_free(req);
314 int io_futex_wake(struct io_kiocb *req, unsigned int issue_flags)
316 struct io_futex *iof = io_kiocb_to_cmd(req, struct io_futex);
326 req_set_fail(req);
327 io_req_set_res(req, ret, 0);