futex.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // SPDX-License-Identifier: GPL-2.0
  2. #include "cancel.h"
  3. int io_futex_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
  4. int io_futexv_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe);
  5. int io_futex_wait(struct io_kiocb *req, unsigned int issue_flags);
  6. int io_futexv_wait(struct io_kiocb *req, unsigned int issue_flags);
  7. int io_futex_wake(struct io_kiocb *req, unsigned int issue_flags);
  8. #if defined(CONFIG_FUTEX)
  9. int io_futex_cancel(struct io_ring_ctx *ctx, struct io_cancel_data *cd,
  10. unsigned int issue_flags);
  11. bool io_futex_remove_all(struct io_ring_ctx *ctx, struct task_struct *task,
  12. bool cancel_all);
  13. bool io_futex_cache_init(struct io_ring_ctx *ctx);
  14. void io_futex_cache_free(struct io_ring_ctx *ctx);
  15. #else
  16. static inline int io_futex_cancel(struct io_ring_ctx *ctx,
  17. struct io_cancel_data *cd,
  18. unsigned int issue_flags)
  19. {
  20. return 0;
  21. }
  22. static inline bool io_futex_remove_all(struct io_ring_ctx *ctx,
  23. struct task_struct *task, bool cancel_all)
  24. {
  25. return false;
  26. }
  27. static inline bool io_futex_cache_init(struct io_ring_ctx *ctx)
  28. {
  29. return false;
  30. }
  31. static inline void io_futex_cache_free(struct io_ring_ctx *ctx)
  32. {
  33. }
  34. #endif