Lines Matching refs:refcount_table

90     while (i > 0 && (s->refcount_table[i] & REFT_OFFSET_MASK) == 0) {  in update_max_refcount_table_index()
110 s->refcount_table = g_try_malloc(refcount_table_size2); in qcow2_refcount_init()
113 if (s->refcount_table == NULL) { in qcow2_refcount_init()
119 s->refcount_table, refcount_table_size2); in qcow2_refcount_init()
124 be64_to_cpus(&s->refcount_table[i]); in qcow2_refcount_init()
135 g_free(s->refcount_table); in qcow2_refcount_close()
258 s->refcount_table[refcount_table_index] & REFT_OFFSET_MASK; in qcow2_get_refcount()
316 s->refcount_table[refcount_table_index] & REFT_OFFSET_MASK; in alloc_refcount_block()
444 s->refcount_table[refcount_table_index] = new_block; in alloc_refcount_block()
583 memcpy(new_table, s->refcount_table, in qcow2_refcount_area()
590 memcpy(new_table, s->refcount_table, table_size * REFTABLE_ENTRY_SIZE); in qcow2_refcount_area()
713 g_free(s->refcount_table); in qcow2_refcount_area()
714 s->refcount_table = new_table; in qcow2_refcount_area()
1524 void **refcount_table, in qcow2_inc_refcounts_imrt() argument
1561 ret = realloc_refcount_array(s, refcount_table, in qcow2_inc_refcounts_imrt()
1569 refcount = s->get_refcount(*refcount_table, k); in qcow2_inc_refcounts_imrt()
1579 s->set_refcount(*refcount_table, k, refcount + 1); in qcow2_inc_refcounts_imrt()
1599 void **refcount_table, in check_refcounts_l2() argument
1646 bs, res, refcount_table, refcount_table_size, in check_refcounts_l2()
1742 ret = qcow2_inc_refcounts_imrt(bs, res, refcount_table, in check_refcounts_l2()
1779 void **refcount_table, in check_refcounts_l1() argument
1791 ret = qcow2_inc_refcounts_imrt(bs, res, refcount_table, refcount_table_size, in check_refcounts_l1()
1822 refcount_table, refcount_table_size, in check_refcounts_l1()
1836 ret = check_refcounts_l2(bs, res, refcount_table, in check_refcounts_l1()
1996 void **refcount_table, int64_t *nb_clusters) in check_refblocks() argument
2004 offset = s->refcount_table[i]; in check_refblocks()
2045 ret = realloc_refcount_array(s, refcount_table, in check_refblocks()
2060 refcount_table, nb_clusters, in check_refblocks()
2079 ret = qcow2_inc_refcounts_imrt(bs, res, refcount_table, nb_clusters, in check_refblocks()
2084 if (s->get_refcount(*refcount_table, cluster) != 1) { in check_refblocks()
2087 s->get_refcount(*refcount_table, cluster)); in check_refblocks()
2102 void **refcount_table, int64_t *nb_clusters) in calculate_refcounts() argument
2109 if (!*refcount_table) { in calculate_refcounts()
2111 ret = realloc_refcount_array(s, refcount_table, in calculate_refcounts()
2120 ret = qcow2_inc_refcounts_imrt(bs, res, refcount_table, nb_clusters, in calculate_refcounts()
2127 ret = check_refcounts_l1(bs, res, refcount_table, nb_clusters, in calculate_refcounts()
2157 ret = check_refcounts_l1(bs, res, refcount_table, nb_clusters, in calculate_refcounts()
2164 ret = qcow2_inc_refcounts_imrt(bs, res, refcount_table, nb_clusters, in calculate_refcounts()
2171 ret = qcow2_inc_refcounts_imrt(bs, res, refcount_table, nb_clusters, in calculate_refcounts()
2181 ret = qcow2_inc_refcounts_imrt(bs, res, refcount_table, nb_clusters, in calculate_refcounts()
2190 ret = qcow2_check_bitmaps_refcounts(bs, res, refcount_table, nb_clusters); in calculate_refcounts()
2195 return check_refblocks(bs, res, fix, rebuild, refcount_table, nb_clusters); in calculate_refcounts()
2205 void *refcount_table, int64_t nb_clusters) in compare_refcounts() argument
2221 refcount2 = s->get_refcount(refcount_table, i); in compare_refcounts()
2280 void **refcount_table, in alloc_clusters_imrt() argument
2297 if (!s->get_refcount(*refcount_table, cluster)) { in alloc_clusters_imrt()
2324 ret = realloc_refcount_array(s, refcount_table, imrt_nb_clusters, in alloc_clusters_imrt()
2335 s->set_refcount(*refcount_table, cluster + i, 1); in alloc_clusters_imrt()
2351 void **refcount_table, in rebuild_refcount_structure() argument
2370 if (!s->get_refcount(*refcount_table, cluster)) { in rebuild_refcount_structure()
2381 refblock_offset = alloc_clusters_imrt(bs, 1, refcount_table, in rebuild_refcount_structure()
2427 refcount_table, nb_clusters, in rebuild_refcount_structure()
2447 on_disk_refblock = (void *)((char *) *refcount_table + in rebuild_refcount_structure()
2472 refcount_table, nb_clusters, in rebuild_refcount_structure()
2521 s->refcount_table = on_disk_reftable; in rebuild_refcount_structure()
2545 void *refcount_table = NULL; in qcow2_check_refcounts() local
2564 ret = calculate_refcounts(bs, res, fix, &rebuild, &refcount_table, in qcow2_check_refcounts()
2574 compare_refcounts(bs, res, 0, &rebuild, &highest_cluster, refcount_table, in qcow2_check_refcounts()
2582 ret = rebuild_refcount_structure(bs, res, &refcount_table, in qcow2_check_refcounts()
2594 memset(refcount_table, 0, refcount_array_byte_size(s, nb_clusters)); in qcow2_check_refcounts()
2595 ret = calculate_refcounts(bs, res, 0, &rebuild, &refcount_table, in qcow2_check_refcounts()
2609 &highest_cluster, refcount_table, nb_clusters); in qcow2_check_refcounts()
2640 refcount_table, nb_clusters); in qcow2_check_refcounts()
2654 g_free(refcount_table); in qcow2_check_refcounts()
2736 if ((chk & QCOW2_OL_REFCOUNT_BLOCK) && s->refcount_table) { in qcow2_check_metadata_overlap()
2740 (s->refcount_table[last_entry + 1] & REFT_OFFSET_MASK) == 0); in qcow2_check_metadata_overlap()
2742 if ((s->refcount_table[i] & REFT_OFFSET_MASK) && in qcow2_check_metadata_overlap()
2743 overlaps_with(s->refcount_table[i] & REFT_OFFSET_MASK, in qcow2_check_metadata_overlap()
2987 uint64_t refblock_offset = s->refcount_table[reftable_index] in walk_over_reftable()
3255 old_reftable = s->refcount_table; in qcow2_change_refcount_order()
3256 s->refcount_table = new_reftable; in qcow2_change_refcount_order()
3307 covering_refblock_offset = s->refcount_table[index] & REFT_OFFSET_MASK; in get_refblock_offset()
3384 int64_t refblock_offs = s->refcount_table[i] & REFT_OFFSET_MASK; in qcow2_shrink_reftable()
3414 reftable_tmp[i] = unused_block ? 0 : cpu_to_be64(s->refcount_table[i]); in qcow2_shrink_reftable()
3425 if (s->refcount_table[i] && !reftable_tmp[i]) { in qcow2_shrink_reftable()
3427 ret = qcow2_discard_refcount_block(bs, s->refcount_table[i] & in qcow2_shrink_reftable()
3430 s->refcount_table[i] = 0; in qcow2_shrink_reftable()