xref: /linux/io_uring/futex.h (revision f03baece08188f2e239c0ca0c098c14c71739ffb)
1194bb58cSJens Axboe // SPDX-License-Identifier: GPL-2.0
2194bb58cSJens Axboe 
3194bb58cSJens Axboe #include "cancel.h"
4194bb58cSJens Axboe 
5194bb58cSJens Axboe int io_futex_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
68f350194SJens Axboe int io_futexv_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
7194bb58cSJens Axboe int io_futex_wait(struct io_kiocb *req, unsigned int issue_flags);
88f350194SJens Axboe int io_futexv_wait(struct io_kiocb *req, unsigned int issue_flags);
9194bb58cSJens Axboe int io_futex_wake(struct io_kiocb *req, unsigned int issue_flags);
10194bb58cSJens Axboe 
11194bb58cSJens Axboe #if defined(CONFIG_FUTEX)
12194bb58cSJens Axboe int io_futex_cancel(struct io_ring_ctx *ctx, struct io_cancel_data *cd,
13194bb58cSJens Axboe 		    unsigned int issue_flags);
14*f03baeceSJens Axboe bool io_futex_remove_all(struct io_ring_ctx *ctx, struct io_uring_task *tctx,
15194bb58cSJens Axboe 			 bool cancel_all);
16414d0f45SJens Axboe bool io_futex_cache_init(struct io_ring_ctx *ctx);
17194bb58cSJens Axboe void io_futex_cache_free(struct io_ring_ctx *ctx);
18194bb58cSJens Axboe #else
19194bb58cSJens Axboe static inline int io_futex_cancel(struct io_ring_ctx *ctx,
20194bb58cSJens Axboe 				  struct io_cancel_data *cd,
21194bb58cSJens Axboe 				  unsigned int issue_flags)
22194bb58cSJens Axboe {
23194bb58cSJens Axboe 	return 0;
24194bb58cSJens Axboe }
25194bb58cSJens Axboe static inline bool io_futex_remove_all(struct io_ring_ctx *ctx,
26*f03baeceSJens Axboe 				       struct io_uring_task *tctx, bool cancel_all)
27194bb58cSJens Axboe {
28194bb58cSJens Axboe 	return false;
29194bb58cSJens Axboe }
30414d0f45SJens Axboe static inline bool io_futex_cache_init(struct io_ring_ctx *ctx)
31194bb58cSJens Axboe {
32414d0f45SJens Axboe 	return false;
33194bb58cSJens Axboe }
34194bb58cSJens Axboe static inline void io_futex_cache_free(struct io_ring_ctx *ctx)
35194bb58cSJens Axboe {
36194bb58cSJens Axboe }
37194bb58cSJens Axboe #endif
38