diff mbox

[Qemu-devel] ceph/rbd block driver for qemu-kvm (v4)

Message ID AANLkTinim=+MebUgSkpn2d2C2vY2bREwBor4xCf27s6n@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Yehuda Sadeh Weinraub Oct. 8, 2010, 3:50 p.m. UTC
None
diff mbox

Patch

diff --git a/block/rbd.c b/block/rbd.c
index 13db079..164e547 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -315,13 +315,16 @@  done:
 static void rbd_aio_completion_cb(void *opaque)
 {
     BDRVRBDState *s = opaque;
+    RBDAIOCB *acb;

-    uint64_t val;
     ssize_t ret;

     do {
-        if ((ret = read(s->efd, &val, sizeof(val))) > 0) {
-            s->qemu_aio_count -= val;
+        if ((ret = read(s->efd, &acb, sizeof(acb))) > 0) {
+            s->qemu_aio_count --;
+            if (!acb->aiocnt && acb->bh) {
+                qemu_bh_schedule(acb->bh);
+            }
         }
     } while (ret < 0 && errno == EINTR);

@@ -539,7 +542,6 @@  static void rbd_finish_aiocb(rados_completion_t c,
RADOSCB *rcb)
 {
     RBDAIOCB *acb = rcb->acb;
     int64_t r;
-    uint64_t buf = 1;
     int i;