Lines Matching refs:cluster_size

370     int64_t new_block = alloc_clusters_noref(bs, s->cluster_size, INT64_MAX);  in alloc_refcount_block()
399 memset(*refcount_block, 0, s->cluster_size); in alloc_refcount_block()
408 ret = update_refcount(bs, new_block, s->cluster_size, 1, false, in alloc_refcount_block()
427 memset(*refcount_block, 0, s->cluster_size); in alloc_refcount_block()
492 s->cluster_size; in alloc_refcount_block()
545 assert(!(start_offset % s->cluster_size)); in qcow2_refcount_area()
547 qcow2_refcount_metadata_size(start_offset / s->cluster_size + in qcow2_refcount_area()
549 s->cluster_size, s->refcount_order, in qcow2_refcount_area()
560 area_reftable_index = (start_offset / s->cluster_size) / in qcow2_refcount_area()
570 table_size = ROUND_UP(table_size, s->cluster_size / REFTABLE_ENTRY_SIZE); in qcow2_refcount_area()
571 table_clusters = (table_size * REFTABLE_ENTRY_SIZE) / s->cluster_size; in qcow2_refcount_area()
611 table_offset = start_offset + additional_refblock_count * s->cluster_size; in qcow2_refcount_area()
612 end_offset = table_offset + table_clusters * s->cluster_size; in qcow2_refcount_area()
633 memset(refblock_data, 0, s->cluster_size); in qcow2_refcount_area()
638 block_offset += s->cluster_size; in qcow2_refcount_area()
643 s->cluster_size; in qcow2_refcount_area()
651 j = (start_offset - first_offset_covered) / s->cluster_size; in qcow2_refcount_area()
658 s->cluster_size, in qcow2_refcount_area()
839 cluster_offset += s->cluster_size) in update_refcount()
905 update_refcount_discard(bs, cluster_offset, s->cluster_size); in update_refcount()
1078 assert(size > 0 && size <= s->cluster_size); in qcow2_alloc_bytes()
1095 free_in_cluster = s->cluster_size - offset_into_cluster(s, offset); in qcow2_alloc_bytes()
1100 new_cluster = alloc_clusters_noref(bs, s->cluster_size, in qcow2_alloc_bytes()
1114 if (!offset || ROUND_UP(offset, s->cluster_size) != new_cluster) { in qcow2_alloc_bytes()
1116 free_in_cluster = s->cluster_size; in qcow2_alloc_bytes()
1118 free_in_cluster += s->cluster_size; in qcow2_alloc_bytes()
1174 s->cluster_size); in qcow2_free_any_cluster()
1197 s->cluster_size, type); in qcow2_free_any_cluster()
1261 n_slices = s->cluster_size / slice_size2; in qcow2_update_snapshot_refcount()
1487 * s->cluster_size; in realloc_refcount_array()
1489 * s->cluster_size; in realloc_refcount_array()
1550 if (offset + size - file_len >= s->cluster_size) { in qcow2_inc_refcounts_imrt()
1561 cluster_offset += s->cluster_size) { in qcow2_inc_refcounts_imrt()
1818 next_contiguous_offset = offset + s->cluster_size; in check_refcounts_l2()
1825 offset, s->cluster_size); in check_refcounts_l2()
1920 l2_offset, s->cluster_size); in check_refcounts_l1()
1956 uint64_t *l2_table = qemu_blockalign(bs, s->cluster_size); in check_oflag_copied()
2053 l2_offset, s->cluster_size, in check_oflag_copied()
2062 ret = bdrv_co_pwrite(bs->file, l2_offset, s->cluster_size, l2_table, 0); in check_oflag_copied()
2125 if (offset > INT64_MAX - s->cluster_size) { in check_refblocks()
2130 ret = bdrv_co_truncate(bs->file, offset + s->cluster_size, false, in check_refblocks()
2161 offset, s->cluster_size); in check_refblocks()
2180 offset, s->cluster_size); in check_refblocks()
2222 0, s->cluster_size); in calculate_refcounts()
2529 refblock_cluster_index = refblock_offset / s->cluster_size; in rebuild_refcounts_write_refblocks()
2541 s->cluster_size) / REFTABLE_ENTRY_SIZE; in rebuild_refcounts_write_refblocks()
2569 s->cluster_size, false); in rebuild_refcounts_write_refblocks()
2582 refblock_index * s->cluster_size); in rebuild_refcounts_write_refblocks()
2584 ret = bdrv_co_pwrite(bs->file, refblock_offset, s->cluster_size, in rebuild_refcounts_write_refblocks()
2697 reftable_start_cluster = reftable_offset / s->cluster_size; in rebuild_refcount_structure()
2895 res->image_end_offset = (highest_cluster + 1) * s->cluster_size; in qcow2_check_refcounts()
2933 if (offset < s->cluster_size) { in qcow2_check_metadata_overlap()
2939 size = ROUND_UP(offset_into_cluster(s, offset) + size, s->cluster_size); in qcow2_check_metadata_overlap()
2975 s->cluster_size)) { in qcow2_check_metadata_overlap()
2989 s->cluster_size)) { in qcow2_check_metadata_overlap()
3023 if (l2_ofs && overlaps_with(l2_ofs, s->cluster_size)) { in qcow2_check_metadata_overlap()
3129 s->cluster_size / REFTABLE_ENTRY_SIZE); in alloc_refblock()
3152 offset = qcow2_alloc_clusters(bs, s->cluster_size); in alloc_refblock()
3182 ret = qcow2_pre_write_overlap_check(bs, 0, offset, s->cluster_size, in flush_refblock()
3189 ret = bdrv_pwrite(bs->file, offset, s->cluster_size, refblock, 0); in flush_refblock()
3369 void *new_refblock = qemu_blockalign(bs->file->bs, s->cluster_size); in qcow2_change_refcount_order()
3533 qcow2_free_clusters(bs, offset, s->cluster_size, in qcow2_change_refcount_order()
3622 update_refcount_discard(bs, discard_block_offs, s->cluster_size); in qcow2_discard_refcount_block()
3657 unused_block = buffer_is_zero(refblock, s->cluster_size); in qcow2_shrink_reftable()
3661 unused_block = buffer_is_zero(refblock, s->cluster_size); in qcow2_shrink_reftable()
3736 real_clusters = real_allocation / s->cluster_size; in qcow2_detect_metadata_preallocation()