diff --git a/qcow/src/qcow.rs b/qcow/src/qcow.rs index c22e32dcb..47e22fd71 100644 --- a/qcow/src/qcow.rs +++ b/qcow/src/qcow.rs @@ -777,10 +777,8 @@ impl QcowFile { refcounts: &mut [u16], cluster_size: u64, refblock_clusters: u64, - pointers_per_cluster: u64, ) -> Result> { - let refcount_table_entries = div_round_up_u64(refblock_clusters, pointers_per_cluster); - let mut ref_table = vec![0; refcount_table_entries as usize]; + let mut ref_table = vec![0; refblock_clusters as usize]; let mut first_free_cluster: u64 = 0; for refblock_addr in &mut ref_table { loop { @@ -907,12 +905,7 @@ impl QcowFile { set_refcount_table_refcounts(&mut refcounts, header, cluster_size)?; // Allocate clusters to store the new reference count blocks. - let ref_table = alloc_refblocks( - &mut refcounts, - cluster_size, - refblock_clusters, - pointers_per_cluster, - )?; + let ref_table = alloc_refblocks(&mut refcounts, cluster_size, refblock_clusters)?; // Write updated reference counts and point the reftable at them. write_refblocks(