xref: /linux/io_uring/loop.h (revision 23acda7c221a76ff711d65f4ca90029d43b249a0)
1 // SPDX-License-Identifier: GPL-2.0
2 #ifndef IOU_LOOP_H
3 #define IOU_LOOP_H
4 
5 #include <linux/io_uring_types.h>
6 
7 struct iou_loop_params {
8 	/*
9 	 * The CQE index to wait for. Only serves as a hint and can still be
10 	 * woken up earlier.
11 	 */
12 	__u32			cq_wait_idx;
13 };
14 
15 enum {
16 	IOU_LOOP_CONTINUE = 0,
17 	IOU_LOOP_STOP,
18 };
19 
io_has_loop_ops(struct io_ring_ctx * ctx)20 static inline bool io_has_loop_ops(struct io_ring_ctx *ctx)
21 {
22 	return data_race(ctx->loop_step);
23 }
24 
25 int io_run_loop(struct io_ring_ctx *ctx);
26 
27 #endif
28