Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __LINUX__AIO_H |
| 2 | #define __LINUX__AIO_H |
| 3 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | #include <linux/aio_abi.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | struct kioctx; |
Kent Overstreet | 0460fef | 2013-05-07 16:18:49 -0700 | [diff] [blame] | 7 | struct kiocb; |
Christoph Hellwig | e2e40f2 | 2015-02-22 08:58:50 -0800 | [diff] [blame] | 8 | struct mm_struct; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | |
Kent Overstreet | 8a66089 | 2013-05-07 16:19:10 -0700 | [diff] [blame] | 10 | #define KIOCB_KEY 0 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 11 | |
Kent Overstreet | bec68faa | 2013-05-13 14:45:08 -0700 | [diff] [blame] | 12 | typedef int (kiocb_cancel_fn)(struct kiocb *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | /* prototypes */ |
Thomas Petazzoni | ebf3f09 | 2008-10-15 22:05:12 -0700 | [diff] [blame] | 15 | #ifdef CONFIG_AIO |
Harvey Harrison | b3c9752 | 2008-02-13 15:03:15 -0800 | [diff] [blame] | 16 | extern void exit_aio(struct mm_struct *mm); |
Jeff Moyer | 9d85cba | 2010-05-26 14:44:26 -0700 | [diff] [blame] | 17 | extern long do_io_submit(aio_context_t ctx_id, long nr, |
| 18 | struct iocb __user *__user *iocbpp, bool compat); |
Kent Overstreet | 0460fef | 2013-05-07 16:18:49 -0700 | [diff] [blame] | 19 | void kiocb_set_cancel_fn(struct kiocb *req, kiocb_cancel_fn *cancel); |
Thomas Petazzoni | ebf3f09 | 2008-10-15 22:05:12 -0700 | [diff] [blame] | 20 | #else |
Thomas Petazzoni | ebf3f09 | 2008-10-15 22:05:12 -0700 | [diff] [blame] | 21 | static inline void exit_aio(struct mm_struct *mm) { } |
Jeff Moyer | 9d85cba | 2010-05-26 14:44:26 -0700 | [diff] [blame] | 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; } |
Kent Overstreet | 0460fef | 2013-05-07 16:18:49 -0700 | [diff] [blame] | 25 | static inline void kiocb_set_cancel_fn(struct kiocb *req, |
| 26 | kiocb_cancel_fn *cancel) { } |
Thomas Petazzoni | ebf3f09 | 2008-10-15 22:05:12 -0700 | [diff] [blame] | 27 | #endif /* CONFIG_AIO */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | /* for sysctl: */ |
Zach Brown | d55b5fd | 2005-11-07 00:59:31 -0800 | [diff] [blame] | 30 | extern unsigned long aio_nr; |
| 31 | extern unsigned long aio_max_nr; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | |
| 33 | #endif /* __LINUX__AIO_H */ |