blob: 9eb42dbc5582ace99283629f0905861ac820c7d5 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __LINUX__AIO_H
2#define __LINUX__AIO_H
3
Linus Torvalds1da177e2005-04-16 15:20:36 -07004#include <linux/aio_abi.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005
Linus Torvalds1da177e2005-04-16 15:20:36 -07006struct kioctx;
Kent Overstreet0460fef2013-05-07 16:18:49 -07007struct kiocb;
Christoph Hellwige2e40f22015-02-22 08:58:50 -08008struct mm_struct;
Linus Torvalds1da177e2005-04-16 15:20:36 -07009
Kent Overstreet8a660892013-05-07 16:19:10 -070010#define KIOCB_KEY 0
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
Kent Overstreetbec68faa2013-05-13 14:45:08 -070012typedef int (kiocb_cancel_fn)(struct kiocb *);
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
Linus Torvalds1da177e2005-04-16 15:20:36 -070014/* prototypes */
Thomas Petazzoniebf3f092008-10-15 22:05:12 -070015#ifdef CONFIG_AIO
Harvey Harrisonb3c97522008-02-13 15:03:15 -080016extern void exit_aio(struct mm_struct *mm);
Jeff Moyer9d85cba2010-05-26 14:44:26 -070017extern long do_io_submit(aio_context_t ctx_id, long nr,
18 struct iocb __user *__user *iocbpp, bool compat);
Kent Overstreet0460fef2013-05-07 16:18:49 -070019void kiocb_set_cancel_fn(struct kiocb *req, kiocb_cancel_fn *cancel);
Thomas Petazzoniebf3f092008-10-15 22:05:12 -070020#else
Thomas Petazzoniebf3f092008-10-15 22:05:12 -070021static inline void exit_aio(struct mm_struct *mm) { }
Jeff Moyer9d85cba2010-05-26 14:44:26 -070022static inline long do_io_submit(aio_context_t ctx_id, long nr,
23 struct iocb __user * __user *iocbpp,
24 bool compat) { return 0; }
Kent Overstreet0460fef2013-05-07 16:18:49 -070025static inline void kiocb_set_cancel_fn(struct kiocb *req,
26 kiocb_cancel_fn *cancel) { }
Thomas Petazzoniebf3f092008-10-15 22:05:12 -070027#endif /* CONFIG_AIO */
Linus Torvalds1da177e2005-04-16 15:20:36 -070028
Linus Torvalds1da177e2005-04-16 15:20:36 -070029/* for sysctl: */
Zach Brownd55b5fd2005-11-07 00:59:31 -080030extern unsigned long aio_nr;
31extern unsigned long aio_max_nr;
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
33#endif /* __LINUX__AIO_H */