diff mbox

[RFC,02/12] qorum: Add QorumSingleAIOCB and QorumAIOCB.

Message ID 1343902604-13981-3-git-send-email-benoit@irqsave.net
State New
Headers show

Commit Message

Benoit Canet Aug. 2, 2012, 10:16 a.m. UTC
Signed-off-by: Benoit Canet <benoit@irqsave.net>
---
 block/qorum.c |   30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
diff mbox

Patch

diff --git a/block/qorum.c b/block/qorum.c
index 3341021..5b4f031 100644
--- a/block/qorum.c
+++ b/block/qorum.c
@@ -13,3 +13,33 @@ 
  * See the COPYING file in the top-level directory.
  */
 
+#include "block_int.h"
+
+typedef struct QorumAIOCB QorumAIOCB;
+
+typedef struct QorumSingleAIOCB {
+    BlockDriverAIOCB *aiocb;
+    char *buf;
+    int ret;
+    QorumAIOCB *parent;
+} QorumSingleAIOCB;
+
+struct QorumAIOCB {
+    BlockDriverAIOCB common;
+    QEMUBH *bh;
+
+    /* Request metadata */
+    bool is_write;
+    int64_t sector_num;
+    int nb_sectors;
+
+    QEMUIOVector *qiov;         /* calling readv IOV */
+
+    QorumSingleAIOCB aios[3];   /* individual AIOs */
+    QEMUIOVector qiovs[3];      /* individual IOVs */
+    int count;                  /* number of completed AIOCB */
+    bool *finished;             /* completion signal for cancel */
+
+    void (*vote)(QorumAIOCB *acb);
+    int vote_ret;
+};