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