static int qcow2_co_flush(BlockDriverState *bs)

{

    BDRVQcowState *s = bs->opaque;

    int ret;



    qemu_co_mutex_lock(&s->lock);

    ret = qcow2_cache_flush(bs, s->l2_table_cache);

    if (ret < 0) {


        return ret;

    }



    ret = qcow2_cache_flush(bs, s->refcount_block_cache);

    if (ret < 0) {


        return ret;

    }




    return bdrv_co_flush(bs->file);

}
static int qcow2_co_flush(BlockDriverState *bs)

{

    BDRVQcowState *s = bs->opaque;

    int ret;



    qemu_co_mutex_lock(&s->lock);

    ret = qcow2_cache_flush(bs, s->l2_table_cache);

    if (ret < 0) {


        return ret;

    }



    ret = qcow2_cache_flush(bs, s->refcount_block_cache);

    if (ret < 0) {


        return ret;

    }




    return bdrv_co_flush(bs->file);

}
static int FUNC_0(BlockDriverState *VAR_0)

{

    BDRVQcowState *s = VAR_0->opaque;

    int VAR_1;



    qemu_co_mutex_lock(&s->lock);

    VAR_1 = qcow2_cache_flush(VAR_0, s->l2_table_cache);

    if (VAR_1 < 0) {


        return VAR_1;

    }



    VAR_1 = qcow2_cache_flush(VAR_0, s->refcount_block_cache);

    if (VAR_1 < 0) {


        return VAR_1;

    }




    return bdrv_co_flush(VAR_0->file);

}
static int FUNC_0(BlockDriverState *VAR_0)
{ BDRVQcowState *s = VAR_0->opaque; int VAR_1; qemu_co_mutex_lock(&s->lock); VAR_1 = qcow2_cache_flush(VAR_0, s->l2_table_cache); if (VAR_1 < 0) { return VAR_1; } VAR_1 = qcow2_cache_flush(VAR_0, s->refcount_block_cache); if (VAR_1 < 0) { return VAR_1; } return bdrv_co_flush(VAR_0->file); }