[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/13] block/linux-aio: pass 'BlockDriverState' to l
From: |
Ming Lei |
Subject: |
[Qemu-devel] [PATCH 05/13] block/linux-aio: pass 'BlockDriverState' to laio_attach_aio_context and its pair |
Date: |
Sun, 9 Nov 2014 15:42:50 +0800 |
This patch introduces parameter of 'BlockDriverState' to
laio_attach_aio_context() and its pair, so that it will be
easier to support IO submission as batch in AioContext wide.
Signed-off-by: Ming Lei <address@hidden>
---
block/linux-aio.c | 6 ++++--
block/raw-aio.h | 6 ++++--
block/raw-posix.c | 4 ++--
3 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/block/linux-aio.c b/block/linux-aio.c
index 95cd0dc..17de2e3 100644
--- a/block/linux-aio.c
+++ b/block/linux-aio.c
@@ -429,7 +429,8 @@ static void laio_state_free(struct qemu_laio_state *s,
AioContext *context)
g_free(s);
}
-void laio_detach_aio_context(void *s_, AioContext *old_context)
+void laio_detach_aio_context(void *s_, BlockDriverState *bs,
+ AioContext *old_context)
{
QemuLaioState *qs = s_;
@@ -437,7 +438,8 @@ void laio_detach_aio_context(void *s_, AioContext
*old_context)
qs->state = NULL;
}
-void laio_attach_aio_context(void *s_, AioContext *new_context)
+void laio_attach_aio_context(void *s_, BlockDriverState *bs,
+ AioContext *new_context)
{
QemuLaioState *qs = s_;
struct qemu_laio_state *s = laio_state_alloc(new_context);
diff --git a/block/raw-aio.h b/block/raw-aio.h
index 80681ce..61a5b96 100644
--- a/block/raw-aio.h
+++ b/block/raw-aio.h
@@ -38,8 +38,10 @@ void laio_cleanup(void *s);
BlockAIOCB *laio_submit(BlockDriverState *bs, void *aio_ctx, int fd,
int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
BlockCompletionFunc *cb, void *opaque, int type);
-void laio_detach_aio_context(void *s, AioContext *old_context);
-void laio_attach_aio_context(void *s, AioContext *new_context);
+void laio_detach_aio_context(void *s, BlockDriverState *bs,
+ AioContext *old_context);
+void laio_attach_aio_context(void *s, BlockDriverState *bs,
+ AioContext *new_context);
void laio_io_plug(BlockDriverState *bs, void *aio_ctx);
int laio_io_unplug(BlockDriverState *bs, void *aio_ctx, bool unplug);
#endif
diff --git a/block/raw-posix.c b/block/raw-posix.c
index e100ae2..5b7f20b 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -323,7 +323,7 @@ static void raw_detach_aio_context(BlockDriverState *bs)
BDRVRawState *s = bs->opaque;
if (s->use_aio) {
- laio_detach_aio_context(s->aio_ctx, bdrv_get_aio_context(bs));
+ laio_detach_aio_context(s->aio_ctx, bs, bdrv_get_aio_context(bs));
}
#endif
}
@@ -335,7 +335,7 @@ static void raw_attach_aio_context(BlockDriverState *bs,
BDRVRawState *s = bs->opaque;
if (s->use_aio) {
- laio_attach_aio_context(s->aio_ctx, new_context);
+ laio_attach_aio_context(s->aio_ctx, bs, new_context);
}
#endif
}
--
1.7.9.5
- [Qemu-devel] [PATCH 00/13] linux-aio/virtio-scsi: support AioContext wide IO submission as batch, Ming Lei, 2014/11/09
- [Qemu-devel] [PATCH 01/13] block/linux-aio: allocate io queue dynamically, Ming Lei, 2014/11/09
- [Qemu-devel] [PATCH 02/13] block: linux-aio: rename 'ctx' of qemu_laiocb as 'laio_state', Ming Lei, 2014/11/09
- [Qemu-devel] [PATCH 03/13] block/linux-aio: allocate 'struct qemu_laio_state' dynamically, Ming Lei, 2014/11/09
- [Qemu-devel] [PATCH 04/13] block/linux-aio: do more things in laio_state_alloc() and its pair, Ming Lei, 2014/11/09
- [Qemu-devel] [PATCH 05/13] block/linux-aio: pass 'BlockDriverState' to laio_attach_aio_context and its pair,
Ming Lei <=
- [Qemu-devel] [PATCH 06/13] AioContext: introduce aio_attach_aio_bs() and its pair, Ming Lei, 2014/11/09
- [Qemu-devel] [PATCH 07/13] block/linux-aio: support IO submission as batch in AioContext wide, Ming Lei, 2014/11/09
- [Qemu-devel] [PATCH 08/13] block/linux-aio.c: allocate events dynamically, Ming Lei, 2014/11/09
- [Qemu-devel] [PATCH 09/13] block/linux-aio.c: introduce laio_alloc_resource(), Ming Lei, 2014/11/09
- [Qemu-devel] [PATCH 10/13] block/linux-aio.c: prepare for elastical resource's allocation, Ming Lei, 2014/11/09
- [Qemu-devel] [PATCH 11/13] block/linux-aio: reallocate I/O resources when aio attached, Ming Lei, 2014/11/09
- [Qemu-devel] [PATCH 12/13] block: introduce bdrv_aio_io_plug() and its pair, Ming Lei, 2014/11/09
- [Qemu-devel] [PATCH 13/13] virtio-scsi-dataplane: support AioContext wide IO submission as batch, Ming Lei, 2014/11/09
- Re: [Qemu-devel] [PATCH 00/13] linux-aio/virtio-scsi: support AioContext wide IO submission as batch, Paolo Bonzini, 2014/11/18