Jeff Dike | 75e5584 | 2005-09-03 15:57:45 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2004 Jeff Dike (jdike@karaya.com) |
| 3 | * Licensed under the GPL |
| 4 | */ |
| 5 | |
| 6 | #ifndef AIO_H__ |
| 7 | #define AIO_H__ |
| 8 | |
| 9 | enum aio_type { AIO_READ, AIO_WRITE, AIO_MMAP }; |
| 10 | |
| 11 | struct aio_thread_reply { |
| 12 | void *data; |
| 13 | int err; |
| 14 | }; |
| 15 | |
| 16 | struct aio_context { |
| 17 | int reply_fd; |
| 18 | struct aio_context *next; |
| 19 | }; |
| 20 | |
| 21 | #define INIT_AIO_CONTEXT { .reply_fd = -1, \ |
| 22 | .next = NULL } |
| 23 | |
Jeff Dike | 91acb21 | 2005-10-10 23:10:32 -0400 | [diff] [blame] | 24 | extern int submit_aio(enum aio_type type, int fd, char *buf, int len, |
| 25 | unsigned long long offset, int reply_fd, |
| 26 | struct aio_context *aio); |
Jeff Dike | 75e5584 | 2005-09-03 15:57:45 -0700 | [diff] [blame] | 27 | |
| 28 | #endif |