diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-03-12 17:01:48 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2012-04-05 14:54:39 +0200 |
commit | 85e8dab1efc7228bb674e72f6fb3be78c1e883bf (patch) | |
tree | edae0953f84c27d1c2f2f0fdfd5b1f7a6efe6ea0 | |
parent | 29cdb2513c3f22f51d6f3585b41009576485cb35 (diff) |
aio: move BlockDriverAIOCB to qemu-aio.h
And remove several block_int.h inclusions that should not be there.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
-rw-r--r-- | block.h | 2 | ||||
-rw-r--r-- | block_int.h | 18 | ||||
-rw-r--r-- | dma-helpers.c | 1 | ||||
-rw-r--r-- | hw/ide/core.c | 1 | ||||
-rw-r--r-- | hw/lsi53c895a.c | 1 | ||||
-rw-r--r-- | linux-aio.c | 1 | ||||
-rw-r--r-- | qemu-aio.h | 21 |
7 files changed, 21 insertions, 24 deletions
@@ -180,8 +180,6 @@ typedef struct BdrvCheckResult { int bdrv_check(BlockDriverState *bs, BdrvCheckResult *res); /* async block I/O */ -typedef struct BlockDriverAIOCB BlockDriverAIOCB; -typedef void BlockDriverCompletionFunc(void *opaque, int ret); typedef void BlockDriverDirtyHandler(BlockDriverState *bs, int64_t sector, int sector_num); BlockDriverAIOCB *bdrv_aio_readv(BlockDriverState *bs, int64_t sector_num, diff --git a/block_int.h b/block_int.h index b460c369ca..22c86a53fe 100644 --- a/block_int.h +++ b/block_int.h @@ -53,12 +53,6 @@ typedef struct BdrvTrackedRequest BdrvTrackedRequest; -typedef struct AIOPool { - void (*cancel)(BlockDriverAIOCB *acb); - int aiocb_size; - BlockDriverAIOCB *free_aiocb; -} AIOPool; - typedef struct BlockIOLimit { int64_t bps[3]; int64_t iops[3]; @@ -302,20 +296,8 @@ struct BlockDriverState { BlockJob *job; }; -struct BlockDriverAIOCB { - AIOPool *pool; - BlockDriverState *bs; - BlockDriverCompletionFunc *cb; - void *opaque; - BlockDriverAIOCB *next; -}; - void get_tmp_filename(char *filename, int size); -void *qemu_aio_get(AIOPool *pool, BlockDriverState *bs, - BlockDriverCompletionFunc *cb, void *opaque); -void qemu_aio_release(void *p); - void bdrv_set_io_limits(BlockDriverState *bs, BlockIOLimit *io_limits); diff --git a/dma-helpers.c b/dma-helpers.c index c29ea6d3ab..7fcc86dca9 100644 --- a/dma-helpers.c +++ b/dma-helpers.c @@ -8,7 +8,6 @@ */ #include "dma.h" -#include "block_int.h" #include "trace.h" void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint) diff --git a/hw/ide/core.c b/hw/ide/core.c index 4d568acc9c..6f06d2818e 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -31,7 +31,6 @@ #include "sysemu.h" #include "dma.h" #include "blockdev.h" -#include "block_int.h" #include <hw/ide/internal.h> diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index edc09b7307..f022a02447 100644 --- a/hw/lsi53c895a.c +++ b/hw/lsi53c895a.c @@ -15,7 +15,6 @@ #include "hw.h" #include "pci.h" #include "scsi.h" -#include "block_int.h" #include "dma.h" //#define DEBUG_LSI diff --git a/linux-aio.c b/linux-aio.c index d2fc2e7d02..15261ece3d 100644 --- a/linux-aio.c +++ b/linux-aio.c @@ -9,7 +9,6 @@ */ #include "qemu-common.h" #include "qemu-aio.h" -#include "block_int.h" #include "block/raw-posix-aio.h" #include <sys/eventfd.h> diff --git a/qemu-aio.h b/qemu-aio.h index 3bdd749f80..230c2f79a0 100644 --- a/qemu-aio.h +++ b/qemu-aio.h @@ -17,6 +17,27 @@ #include "qemu-common.h" #include "qemu-char.h" +typedef struct BlockDriverAIOCB BlockDriverAIOCB; +typedef void BlockDriverCompletionFunc(void *opaque, int ret); + +typedef struct AIOPool { + void (*cancel)(BlockDriverAIOCB *acb); + int aiocb_size; + BlockDriverAIOCB *free_aiocb; +} AIOPool; + +struct BlockDriverAIOCB { + AIOPool *pool; + BlockDriverState *bs; + BlockDriverCompletionFunc *cb; + void *opaque; + BlockDriverAIOCB *next; +}; + +void *qemu_aio_get(AIOPool *pool, BlockDriverState *bs, + BlockDriverCompletionFunc *cb, void *opaque); +void qemu_aio_release(void *p); + /* Returns 1 if there are still outstanding AIO requests; 0 otherwise */ typedef int (AioFlushHandler)(void *opaque); |