qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 12/13] block: introduce bdrv_aio_io_plug() and its p


From: Ming Lei
Subject: [Qemu-devel] [PATCH 12/13] block: introduce bdrv_aio_io_plug() and its pair
Date: Sun, 9 Nov 2014 15:42:57 +0800

These two APIs are introduced for using AioContext wide
IO submission as batch.

Signed-off-by: Ming Lei <address@hidden>
---
 block.c               |   16 ++++++++++++++++
 include/block/block.h |    3 +++
 2 files changed, 19 insertions(+)

diff --git a/block.c b/block.c
index dacd881..0200af0 100644
--- a/block.c
+++ b/block.c
@@ -5901,6 +5901,22 @@ void bdrv_io_unplug(BlockDriverState *bs)
     }
 }
 
+bool bdrv_aio_io_plug(AioContext *aio_ctx)
+{
+    if (aio_ctx->master_aio_bs) {
+        bdrv_io_plug(aio_ctx->master_aio_bs);
+        return true;
+    }
+    return false;
+}
+
+void bdrv_aio_io_unplug(AioContext *aio_ctx)
+{
+    if (aio_ctx->master_aio_bs) {
+        bdrv_io_unplug(aio_ctx->master_aio_bs);
+    }
+}
+
 void bdrv_flush_io_queue(BlockDriverState *bs)
 {
     BlockDriver *drv = bs->drv;
diff --git a/include/block/block.h b/include/block/block.h
index 13e4537..aae6b66 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -541,6 +541,9 @@ void bdrv_io_plug(BlockDriverState *bs);
 void bdrv_io_unplug(BlockDriverState *bs);
 void bdrv_flush_io_queue(BlockDriverState *bs);
 
+bool bdrv_aio_io_plug(AioContext *aio_ctx);
+void bdrv_aio_io_unplug(AioContext *aio_ctx);
+
 BlockAcctStats *bdrv_get_stats(BlockDriverState *bs);
 
 #endif
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]