@@ -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;
+};
Signed-off-by: Benoit Canet <benoit@irqsave.net> --- block/qorum.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)