static int load_refcount_block(BlockDriverState *bs,

                               int64_t refcount_block_offset)

{

    BDRVQcowState *s = bs->opaque;

    int ret;



    if (cache_refcount_updates) {

        ret = write_refcount_block(bs);

        if (ret < 0) {

            return ret;

        }

    }



    BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_LOAD);

    ret = bdrv_pread(bs->file, refcount_block_offset, s->refcount_block_cache,

                     s->cluster_size);

    if (ret < 0) {


        return ret;

    }



    s->refcount_block_cache_offset = refcount_block_offset;

    return 0;

}
static int load_refcount_block(BlockDriverState *bs,

                               int64_t refcount_block_offset)

{

    BDRVQcowState *s = bs->opaque;

    int ret;



    if (cache_refcount_updates) {

        ret = write_refcount_block(bs);

        if (ret < 0) {

            return ret;

        }

    }



    BLKDBG_EVENT(bs->file, BLKDBG_REFBLOCK_LOAD);

    ret = bdrv_pread(bs->file, refcount_block_offset, s->refcount_block_cache,

                     s->cluster_size);

    if (ret < 0) {


        return ret;

    }



    s->refcount_block_cache_offset = refcount_block_offset;

    return 0;

}
static int FUNC_0(BlockDriverState *VAR_0,

                               int64_t VAR_1)

{

    BDRVQcowState *s = VAR_0->opaque;

    int VAR_2;



    if (cache_refcount_updates) {

        VAR_2 = write_refcount_block(VAR_0);

        if (VAR_2 < 0) {

            return VAR_2;

        }

    }



    BLKDBG_EVENT(VAR_0->file, BLKDBG_REFBLOCK_LOAD);

    VAR_2 = bdrv_pread(VAR_0->file, VAR_1, s->refcount_block_cache,

                     s->cluster_size);

    if (VAR_2 < 0) {


        return VAR_2;

    }



    s->refcount_block_cache_offset = VAR_1;

    return 0;

}
static int FUNC_0(BlockDriverState *VAR_0,
int64_t VAR_1)
{ BDRVQcowState *s = VAR_0->opaque; int VAR_2; if (cache_refcount_updates) { VAR_2 = write_refcount_block(VAR_0); if (VAR_2 < 0) { return VAR_2; } } BLKDBG_EVENT(VAR_0->file, BLKDBG_REFBLOCK_LOAD); VAR_2 = bdrv_pread(VAR_0->file, VAR_1, s->refcount_block_cache,
s->cluster_size); if (VAR_2 < 0) { return VAR_2; } s->refcount_block_cache_offset = VAR_1; return 0; }