aio.h 879 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef __LINUX__AIO_H
  2. #define __LINUX__AIO_H
  3. #include <linux/aio_abi.h>
  4. struct kioctx;
  5. struct kiocb;
  6. struct mm_struct;
  7. #define KIOCB_KEY 0
  8. typedef int (kiocb_cancel_fn)(struct kiocb *);
  9. /* prototypes */
  10. #ifdef CONFIG_AIO
  11. extern void exit_aio(struct mm_struct *mm);
  12. extern long do_io_submit(aio_context_t ctx_id, long nr,
  13. struct iocb __user *__user *iocbpp, bool compat);
  14. void kiocb_set_cancel_fn(struct kiocb *req, kiocb_cancel_fn *cancel);
  15. #else
  16. static inline void exit_aio(struct mm_struct *mm) { }
  17. static inline long do_io_submit(aio_context_t ctx_id, long nr,
  18. struct iocb __user * __user *iocbpp,
  19. bool compat) { return 0; }
  20. static inline void kiocb_set_cancel_fn(struct kiocb *req,
  21. kiocb_cancel_fn *cancel) { }
  22. #endif /* CONFIG_AIO */
  23. /* for sysctl: */
  24. extern unsigned long aio_nr;
  25. extern unsigned long aio_max_nr;
  26. #endif /* __LINUX__AIO_H */