aio.h 879 Bytes
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1 2 3 4 5 6
#ifndef __LINUX__AIO_H
#define __LINUX__AIO_H

#include <linux/aio_abi.h>

struct kioctx;
7
struct kiocb;
8
struct mm_struct;
Linus Torvalds's avatar
Linus Torvalds committed
9

Kent Overstreet's avatar
Kent Overstreet committed
10
#define KIOCB_KEY		0
Linus Torvalds's avatar
Linus Torvalds committed
11

12
typedef int (kiocb_cancel_fn)(struct kiocb *);
Linus Torvalds's avatar
Linus Torvalds committed
13 14

/* prototypes */
15
#ifdef CONFIG_AIO
16
extern void exit_aio(struct mm_struct *mm);
17 18
extern long do_io_submit(aio_context_t ctx_id, long nr,
			 struct iocb __user *__user *iocbpp, bool compat);
19
void kiocb_set_cancel_fn(struct kiocb *req, kiocb_cancel_fn *cancel);
20 21
#else
static inline void exit_aio(struct mm_struct *mm) { }
22 23 24
static inline long do_io_submit(aio_context_t ctx_id, long nr,
				struct iocb __user * __user *iocbpp,
				bool compat) { return 0; }
25 26
static inline void kiocb_set_cancel_fn(struct kiocb *req,
				       kiocb_cancel_fn *cancel) { }
27
#endif /* CONFIG_AIO */
Linus Torvalds's avatar
Linus Torvalds committed
28 29

/* for sysctl: */
30 31
extern unsigned long aio_nr;
extern unsigned long aio_max_nr;
Linus Torvalds's avatar
Linus Torvalds committed
32 33

#endif /* __LINUX__AIO_H */