Patchwork [RFC,V5,06/11] quorum: Add quorum_co_flush().

login
register
mail settings
Submitter Benoit Canet
Date Aug. 27, 2012, 7:30 a.m.
Message ID <1346052629-15686-7-git-send-email-benoit@irqsave.net>
Download mbox | patch
Permalink /patch/180145/
State New
Headers show

Comments

Benoit Canet - Aug. 27, 2012, 7:30 a.m.
Signed-off-by: Benoit Canet <benoit@irqsave.net>
---
 block/quorum.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

Patch

diff --git a/block/quorum.c b/block/quorum.c
index cd11cfb..f83b4cf 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -282,6 +282,18 @@  static BlockDriverAIOCB *quorum_aio_writev(BlockDriverState *bs,
     return &acb->common;
 }
 
+static coroutine_fn int quorum_co_flush(BlockDriverState *bs)
+{
+    BDRVQuorumState *s = bs->opaque;
+    int i;
+
+    for (i = 0; i < s->total; i++) {
+        bdrv_co_flush(s->bs[i]);
+    }
+
+    return 0;
+}
+
 static BlockDriver bdrv_quorum = {
     .format_name        = "quorum",
     .protocol_name      = "quorum",
@@ -290,6 +302,7 @@  static BlockDriver bdrv_quorum = {
 
     .bdrv_file_open     = quorum_open,
     .bdrv_close         = quorum_close,
+    .bdrv_co_flush_to_disk = quorum_co_flush,
 
     .bdrv_aio_writev    = quorum_aio_writev,
 };