From 1e5b9d2fccb205ed8fc84fb38945b8fb3d225640 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Mon, 26 Oct 2009 13:03:08 +0100 Subject: Remove aio_ctx from paio_* interface The context parameter in paio_submit isn't used anyway, so there is no reason why block drivers should need to remember it. This also avoids passing a Linux AIO context to paio_submit (which doesn't do any harm as long as the parameter is unused, but it is highly confusing). Signed-off-by: Kevin Wolf Signed-off-by: Anthony Liguori --- block/raw-posix.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'block/raw-posix.c') diff --git a/block/raw-posix.c b/block/raw-posix.c index 5547fb5..f558976 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -107,7 +107,6 @@ typedef struct BDRVRawState { int type; unsigned int lseek_err_cnt; int open_flags; - void *aio_ctx; #if defined(__linux__) /* linux floppy specific */ int64_t fd_open_time; @@ -117,6 +116,7 @@ typedef struct BDRVRawState { #endif #ifdef CONFIG_LINUX_AIO int use_aio; + void *aio_ctx; #endif uint8_t* aligned_buf; } BDRVRawState; @@ -185,8 +185,7 @@ static int raw_open_common(BlockDriverState *bs, const char *filename, } else #endif { - s->aio_ctx = paio_init(); - if (!s->aio_ctx) { + if (paio_init() < 0) { goto out_free_buf; } #ifdef CONFIG_LINUX_AIO @@ -558,7 +557,7 @@ static BlockDriverAIOCB *raw_aio_submit(BlockDriverState *bs, } } - return paio_submit(bs, s->aio_ctx, s->fd, sector_num, qiov, nb_sectors, + return paio_submit(bs, s->fd, sector_num, qiov, nb_sectors, cb, opaque, type); } @@ -586,8 +585,7 @@ static BlockDriverAIOCB *raw_aio_flush(BlockDriverState *bs, if (fd_open(bs) < 0) return NULL; - return paio_submit(bs, s->aio_ctx, s->fd, 0, NULL, 0, - cb, opaque, QEMU_AIO_FLUSH); + return paio_submit(bs, s->fd, 0, NULL, 0, cb, opaque, QEMU_AIO_FLUSH); } static void raw_close(BlockDriverState *bs) -- cgit v1.1