Statistics
| Branch: | Revision:

root / block / raw-posix-aio.h @ 57e69b7d

History | View | Annotate | Download (1.3 kB)

1 9ef91a67 Christoph Hellwig
/*
2 9ef91a67 Christoph Hellwig
 * QEMU Posix block I/O backend AIO support
3 9ef91a67 Christoph Hellwig
 *
4 9ef91a67 Christoph Hellwig
 * Copyright IBM, Corp. 2008
5 9ef91a67 Christoph Hellwig
 *
6 9ef91a67 Christoph Hellwig
 * Authors:
7 9ef91a67 Christoph Hellwig
 *  Anthony Liguori   <aliguori@us.ibm.com>
8 9ef91a67 Christoph Hellwig
 *
9 9ef91a67 Christoph Hellwig
 * This work is licensed under the terms of the GNU GPL, version 2.  See
10 9ef91a67 Christoph Hellwig
 * the COPYING file in the top-level directory.
11 9ef91a67 Christoph Hellwig
 *
12 9ef91a67 Christoph Hellwig
 */
13 9ef91a67 Christoph Hellwig
#ifndef QEMU_RAW_POSIX_AIO_H
14 9ef91a67 Christoph Hellwig
#define QEMU_RAW_POSIX_AIO_H
15 9ef91a67 Christoph Hellwig
16 9ef91a67 Christoph Hellwig
/* AIO request types */
17 9ef91a67 Christoph Hellwig
#define QEMU_AIO_READ         0x0001
18 9ef91a67 Christoph Hellwig
#define QEMU_AIO_WRITE        0x0002
19 9ef91a67 Christoph Hellwig
#define QEMU_AIO_IOCTL        0x0004
20 b2e12bc6 Christoph Hellwig
#define QEMU_AIO_FLUSH        0x0008
21 9ef91a67 Christoph Hellwig
#define QEMU_AIO_TYPE_MASK \
22 b2e12bc6 Christoph Hellwig
        (QEMU_AIO_READ|QEMU_AIO_WRITE|QEMU_AIO_IOCTL|QEMU_AIO_FLUSH)
23 9ef91a67 Christoph Hellwig
24 9ef91a67 Christoph Hellwig
/* AIO flags */
25 9ef91a67 Christoph Hellwig
#define QEMU_AIO_MISALIGNED   0x1000
26 9ef91a67 Christoph Hellwig
27 9ef91a67 Christoph Hellwig
28 9ef91a67 Christoph Hellwig
/* posix-aio-compat.c - thread pool based implementation */
29 1e5b9d2f Kevin Wolf
int paio_init(void);
30 1e5b9d2f Kevin Wolf
BlockDriverAIOCB *paio_submit(BlockDriverState *bs, int fd,
31 9ef91a67 Christoph Hellwig
        int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
32 9ef91a67 Christoph Hellwig
        BlockDriverCompletionFunc *cb, void *opaque, int type);
33 9ef91a67 Christoph Hellwig
BlockDriverAIOCB *paio_ioctl(BlockDriverState *bs, int fd,
34 9ef91a67 Christoph Hellwig
        unsigned long int req, void *buf,
35 9ef91a67 Christoph Hellwig
        BlockDriverCompletionFunc *cb, void *opaque);
36 9ef91a67 Christoph Hellwig
37 5c6c3a6c Christoph Hellwig
/* linux-aio.c - Linux native implementation */
38 5c6c3a6c Christoph Hellwig
void *laio_init(void);
39 5c6c3a6c Christoph Hellwig
BlockDriverAIOCB *laio_submit(BlockDriverState *bs, void *aio_ctx, int fd,
40 5c6c3a6c Christoph Hellwig
        int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
41 5c6c3a6c Christoph Hellwig
        BlockDriverCompletionFunc *cb, void *opaque, int type);
42 5c6c3a6c Christoph Hellwig
43 9ef91a67 Christoph Hellwig
#endif /* QEMU_RAW_POSIX_AIO_H */