static int blk_free(struct XenDevice *xendev)

{

    struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);

    struct ioreq *ioreq;



    while (!LIST_EMPTY(&blkdev->freelist)) {

	ioreq = LIST_FIRST(&blkdev->freelist);

        LIST_REMOVE(ioreq, list);

        qemu_iovec_destroy(&ioreq->v);

	qemu_free(ioreq);

    }



    qemu_free(blkdev->params);

    qemu_free(blkdev->mode);

    qemu_free(blkdev->type);

    qemu_free(blkdev->dev);

    qemu_free(blkdev->devtype);

    qemu_bh_delete(blkdev->bh);

    return 0;

}

static int blk_free(struct XenDevice *xendev)

{

    struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);

    struct ioreq *ioreq;



    while (!LIST_EMPTY(&blkdev->freelist)) {

	ioreq = LIST_FIRST(&blkdev->freelist);

        LIST_REMOVE(ioreq, list);

        qemu_iovec_destroy(&ioreq->v);

	qemu_free(ioreq);

    }



    qemu_free(blkdev->params);

    qemu_free(blkdev->mode);

    qemu_free(blkdev->type);

    qemu_free(blkdev->dev);

    qemu_free(blkdev->devtype);

    qemu_bh_delete(blkdev->bh);

    return 0;

}

static int FUNC_0(struct XenDevice *VAR_0)

{

    struct XenBlkDev *VAR_1 = container_of(VAR_0, struct XenBlkDev, VAR_0);

    struct VAR_2 *VAR_2;



    while (!LIST_EMPTY(&VAR_1->freelist)) {

	VAR_2 = LIST_FIRST(&VAR_1->freelist);

        LIST_REMOVE(VAR_2, list);

        qemu_iovec_destroy(&VAR_2->v);

	qemu_free(VAR_2);

    }



    qemu_free(VAR_1->params);

    qemu_free(VAR_1->mode);

    qemu_free(VAR_1->type);

    qemu_free(VAR_1->dev);

    qemu_free(VAR_1->devtype);

    qemu_bh_delete(VAR_1->bh);

    return 0;

}

static int FUNC_0(struct XenDevice *VAR_0)
{ struct XenBlkDev *VAR_1 = container_of(VAR_0, struct XenBlkDev, VAR_0); struct VAR_2 *VAR_2; while (!LIST_EMPTY(&VAR_1->freelist)) { VAR_2 = LIST_FIRST(&VAR_1->freelist); LIST_REMOVE(VAR_2, list); qemu_iovec_destroy(&VAR_2->v); qemu_free(VAR_2); } qemu_free(VAR_1->params); qemu_free(VAR_1->mode); qemu_free(VAR_1->type); qemu_free(VAR_1->dev); qemu_free(VAR_1->devtype); qemu_bh_delete(VAR_1->bh); return 0; }