static int ioreq_runio_qemu_aio(struct ioreq *ioreq)

{

    struct XenBlkDev *blkdev = ioreq->blkdev;



    if (ioreq->req.nr_segments && ioreq_map(ioreq) == -1)

	goto err;



    ioreq->aio_inflight++;

    if (ioreq->presync)

	bdrv_flush(blkdev->bs); /* FIXME: aio_flush() ??? */



    switch (ioreq->req.operation) {

    case BLKIF_OP_READ:

        ioreq->aio_inflight++;

        bdrv_aio_readv(blkdev->bs, ioreq->start / BLOCK_SIZE,

                       &ioreq->v, ioreq->v.size / BLOCK_SIZE,

                       qemu_aio_complete, ioreq);

	break;

    case BLKIF_OP_WRITE:

    case BLKIF_OP_WRITE_BARRIER:

        ioreq->aio_inflight++;

        if (!ioreq->req.nr_segments)

            break;

        bdrv_aio_writev(blkdev->bs, ioreq->start / BLOCK_SIZE,

                        &ioreq->v, ioreq->v.size / BLOCK_SIZE,

                        qemu_aio_complete, ioreq);

	break;

    default:

	/* unknown operation (shouldn't happen -- parse catches this) */

	goto err;

    }



    if (ioreq->postsync)

	bdrv_flush(blkdev->bs); /* FIXME: aio_flush() ??? */

    qemu_aio_complete(ioreq, 0);



    return 0;



err:

    ioreq->status = BLKIF_RSP_ERROR;

    return -1;

}

static int ioreq_runio_qemu_aio(struct ioreq *ioreq)

{

    struct XenBlkDev *blkdev = ioreq->blkdev;



    if (ioreq->req.nr_segments && ioreq_map(ioreq) == -1)

	goto err;



    ioreq->aio_inflight++;

    if (ioreq->presync)

	bdrv_flush(blkdev->bs); 



    switch (ioreq->req.operation) {

    case BLKIF_OP_READ:

        ioreq->aio_inflight++;

        bdrv_aio_readv(blkdev->bs, ioreq->start / BLOCK_SIZE,

                       &ioreq->v, ioreq->v.size / BLOCK_SIZE,

                       qemu_aio_complete, ioreq);

	break;

    case BLKIF_OP_WRITE:

    case BLKIF_OP_WRITE_BARRIER:

        ioreq->aio_inflight++;

        if (!ioreq->req.nr_segments)

            break;

        bdrv_aio_writev(blkdev->bs, ioreq->start / BLOCK_SIZE,

                        &ioreq->v, ioreq->v.size / BLOCK_SIZE,

                        qemu_aio_complete, ioreq);

	break;

    default:

	

	goto err;

    }



    if (ioreq->postsync)

	bdrv_flush(blkdev->bs); 

    qemu_aio_complete(ioreq, 0);



    return 0;



err:

    ioreq->status = BLKIF_RSP_ERROR;

    return -1;

}

        ioreq->aio_inflight++;
static int FUNC_0(struct VAR_0 *VAR_0)

{

    struct XenBlkDev *VAR_1 = VAR_0->VAR_1;



    if (VAR_0->req.nr_segments && ioreq_map(VAR_0) == -1)

	goto err;



    VAR_0->aio_inflight++;

    if (VAR_0->presync)

	bdrv_flush(VAR_1->bs); 



    switch (VAR_0->req.operation) {

    case BLKIF_OP_READ:

        VAR_0->aio_inflight++;

        bdrv_aio_readv(VAR_1->bs, VAR_0->start / BLOCK_SIZE,

                       &VAR_0->v, VAR_0->v.size / BLOCK_SIZE,

                       qemu_aio_complete, VAR_0);

	break;

    case BLKIF_OP_WRITE:

    case BLKIF_OP_WRITE_BARRIER:

        VAR_0->aio_inflight++;

        if (!VAR_0->req.nr_segments)

            break;

        bdrv_aio_writev(VAR_1->bs, VAR_0->start / BLOCK_SIZE,

                        &VAR_0->v, VAR_0->v.size / BLOCK_SIZE,

                        qemu_aio_complete, VAR_0);

	break;

    default:

	

	goto err;

    }



    if (VAR_0->postsync)

	bdrv_flush(VAR_1->bs); 

    qemu_aio_complete(VAR_0, 0);



    return 0;



err:

    VAR_0->status = BLKIF_RSP_ERROR;

    return -1;

}

static int FUNC_0(struct VAR_0 *VAR_0)
{ struct XenBlkDev *VAR_1 = VAR_0->VAR_1; if (VAR_0->req.nr_segments && ioreq_map(VAR_0) == -1)
goto err; VAR_0->aio_inflight++; if (VAR_0->presync)
bdrv_flush(VAR_1->bs); switch (VAR_0->req.operation) { case BLKIF_OP_READ:
VAR_0->aio_inflight++; bdrv_aio_readv(VAR_1->bs, VAR_0->start / BLOCK_SIZE,
&VAR_0->v, VAR_0->v.size / BLOCK_SIZE,
qemu_aio_complete, VAR_0); break; case BLKIF_OP_WRITE:
case BLKIF_OP_WRITE_BARRIER:
VAR_0->aio_inflight++; if (!VAR_0->req.nr_segments)
break; bdrv_aio_writev(VAR_1->bs, VAR_0->start / BLOCK_SIZE,
&VAR_0->v, VAR_0->v.size / BLOCK_SIZE,
qemu_aio_complete, VAR_0); break; default:
goto err; } if (VAR_0->postsync)
bdrv_flush(VAR_1->bs); qemu_aio_complete(VAR_0, 0); return 0; err:
VAR_0->status = BLKIF_RSP_ERROR; return -1; }