Lines Matching refs:refcount
483 int block_index, refcount; in update_refcount() local
520 refcount = be16_to_cpu(s->refcount_block_cache[block_index]); in update_refcount()
521 refcount += addend; in update_refcount()
522 if (refcount < 0 || refcount > 0xffff) { in update_refcount()
526 if (refcount == 0 && cluster_index < s->free_cluster_index) { in update_refcount()
529 s->refcount_block_cache[block_index] = cpu_to_be16(refcount); in update_refcount()
590 int i, nb_clusters, refcount; in alloc_clusters_noref() local
596 refcount = get_refcount(bs, next_cluster_index); in alloc_clusters_noref()
598 if (refcount < 0) { in alloc_clusters_noref()
599 return refcount; in alloc_clusters_noref()
600 } else if (refcount != 0) { in alloc_clusters_noref()
729 int refcount; in qcow2_create_refcount_update() local
738 refcount = be16_to_cpu(*p); in qcow2_create_refcount_update()
739 refcount++; in qcow2_create_refcount_update()
740 *p = cpu_to_be16(refcount); in qcow2_create_refcount_update()
751 int l2_size, i, j, l1_modified, l2_modified, nb_csectors, refcount; in qcow2_update_snapshot_refcount() local
806 refcount = 2; in qcow2_update_snapshot_refcount()
809 … refcount = update_cluster_refcount(bs, offset >> s->cluster_bits, addend); in qcow2_update_snapshot_refcount()
811 refcount = get_refcount(bs, offset >> s->cluster_bits); in qcow2_update_snapshot_refcount()
814 if (refcount < 0) { in qcow2_update_snapshot_refcount()
819 if (refcount == 1) { in qcow2_update_snapshot_refcount()
835 refcount = update_cluster_refcount(bs, l2_offset >> s->cluster_bits, addend); in qcow2_update_snapshot_refcount()
837 refcount = get_refcount(bs, l2_offset >> s->cluster_bits); in qcow2_update_snapshot_refcount()
839 if (refcount < 0) { in qcow2_update_snapshot_refcount()
841 } else if (refcount == 1) { in qcow2_update_snapshot_refcount()
940 int i, l2_size, nb_csectors, refcount; in check_refcounts_l2() local
974 refcount = get_refcount(bs, offset >> s->cluster_bits); in check_refcounts_l2()
975 if (refcount < 0) { in check_refcounts_l2()
977 PRIx64 ": %s\n", entry, strerror(-refcount)); in check_refcounts_l2()
980 if ((refcount == 1) != ((entry & QCOW_OFLAG_COPIED) != 0)) { in check_refcounts_l2()
982 PRIx64 " refcount=%d\n", entry, refcount); in check_refcounts_l2()
1028 int i, refcount, ret; in check_refcounts_l1() local
1054 refcount = get_refcount(bs, (l2_offset & ~QCOW_OFLAG_COPIED) in check_refcounts_l1()
1056 if (refcount < 0) { in check_refcounts_l1()
1058 PRIx64 ": %s\n", l2_offset, strerror(-refcount)); in check_refcounts_l1()
1061 if ((refcount == 1) != ((l2_offset & QCOW_OFLAG_COPIED) != 0)) { in check_refcounts_l1()
1063 " refcount=%d\n", l2_offset, refcount); in check_refcounts_l1()