Lines Matching refs:cluster_index
247 int qcow2_get_refcount(BlockDriverState *bs, int64_t cluster_index, in qcow2_get_refcount() argument
256 refcount_table_index = cluster_index >> s->refcount_block_bits; in qcow2_get_refcount()
281 block_index = cluster_index & (s->refcount_block_size - 1); in qcow2_get_refcount()
306 alloc_refcount_block(BlockDriverState *bs, int64_t cluster_index, in alloc_refcount_block() argument
316 refcount_table_index = cluster_index >> s->refcount_block_bits; in alloc_refcount_block()
388 refcount_table_index, cluster_index << s->cluster_bits, new_block); in alloc_refcount_block()
391 if (in_same_refcount_block(s, new_block, cluster_index << s->cluster_bits)) { in alloc_refcount_block()
486 uint64_t blocks_used = DIV_ROUND_UP(MAX(cluster_index + 1, in alloc_refcount_block()
843 int64_t cluster_index = cluster_offset >> s->cluster_bits; in update_refcount() local
844 int64_t table_index = cluster_index >> s->refcount_block_bits; in update_refcount()
851 ret = alloc_refcount_block(bs, cluster_index, &refcount_block); in update_refcount()
868 block_index = cluster_index & (s->refcount_block_size - 1); in update_refcount()
883 if (refcount == 0 && cluster_index < s->free_cluster_index) { in update_refcount()
884 s->free_cluster_index = cluster_index; in update_refcount()
944 int64_t cluster_index, in qcow2_update_cluster_refcount() argument
951 ret = update_refcount(bs, cluster_index << s->cluster_bits, 1, addend, in qcow2_update_cluster_refcount()
1035 uint64_t cluster_index, refcount; in qcow2_alloc_clusters_at() local
1046 cluster_index = offset >> s->cluster_bits; in qcow2_alloc_clusters_at()
1048 ret = qcow2_get_refcount(bs, cluster_index++, &refcount); in qcow2_alloc_clusters_at()
1313 uint64_t cluster_index; in qcow2_update_snapshot_refcount() local
1356 cluster_index = offset >> s->cluster_bits; in qcow2_update_snapshot_refcount()
1357 assert(cluster_index); in qcow2_update_snapshot_refcount()
1360 bs, cluster_index, abs(addend), addend < 0, in qcow2_update_snapshot_refcount()
1367 ret = qcow2_get_refcount(bs, cluster_index, &refcount); in qcow2_update_snapshot_refcount()
3575 uint64_t cluster_index = discard_block_offs >> s->cluster_bits; in qcow2_discard_refcount_block() local
3576 uint32_t block_index = cluster_index & (s->refcount_block_size - 1); in qcow2_discard_refcount_block()
3612 if (cluster_index < s->free_cluster_index) { in qcow2_discard_refcount_block()
3613 s->free_cluster_index = cluster_index; in qcow2_discard_refcount_block()