Skip to content

Commit

Permalink
aio: move BlockDriverAIOCB to qemu-aio.h
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bonzini authored and kevmw committed Apr 5, 2012
1 parent 29cdb25 commit 85e8dab
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 24 deletions.
2 changes: 0 additions & 2 deletions block.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
18 changes: 0 additions & 18 deletions block_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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);

Expand Down
1 change: 0 additions & 1 deletion dma-helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
*/

#include "dma.h"
#include "block_int.h"
#include "trace.h"

void qemu_sglist_init(QEMUSGList *qsg, int alloc_hint)
Expand Down
1 change: 0 additions & 1 deletion hw/ide/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "sysemu.h"
#include "dma.h"
#include "blockdev.h"
#include "block_int.h"

#include <hw/ide/internal.h>

Expand Down
1 change: 0 additions & 1 deletion hw/lsi53c895a.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "hw.h"
#include "pci.h"
#include "scsi.h"
#include "block_int.h"
#include "dma.h"

//#define DEBUG_LSI
Expand Down
1 change: 0 additions & 1 deletion linux-aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
21 changes: 21 additions & 0 deletions qemu-aio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 85e8dab

Please sign in to comment.