|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH 2/3] xen_disk: use bdrv_aio_flush instead of bdrv_flush
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
hw/xen_disk.c | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index f9ef062..900f456 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -382,8 +382,6 @@ static void qemu_aio_complete(void *opaque, int ret)
ioreq->aio_inflight--;
if (ioreq->aio_inflight > 0)
return;
- if (ioreq->postsync)
- bdrv_flush(ioreq->blkdev->bs);
ioreq->status = ioreq->aio_errors ? BLKIF_RSP_ERROR : BLKIF_RSP_OKAY;
ioreq_unmap(ioreq);
@@ -398,9 +396,10 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
if (ioreq->req.nr_segments && ioreq_map(ioreq) == -1)
goto err;
- ioreq->aio_inflight++;
- if (ioreq->presync)
- bdrv_flush(blkdev->bs); /* FIXME: aio_flush() ??? */
+ if (ioreq->presync) {
+ ioreq->aio_inflight++;
+ bdrv_aio_flush(ioreq->blkdev->bs, qemu_aio_complete, ioreq);
+ }
switch (ioreq->req.operation) {
case BLKIF_OP_READ:
@@ -422,8 +421,10 @@ static int ioreq_runio_qemu_aio(struct ioreq *ioreq)
/* unknown operation (shouldn't happen -- parse catches this) */
goto err;
}
-
- qemu_aio_complete(ioreq, 0);
+ if (ioreq->postsync) {
+ ioreq->aio_inflight++;
+ bdrv_aio_flush(ioreq->blkdev->bs, qemu_aio_complete, ioreq);
+ }
return 0;
--
1.7.2.5
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |