Signed-off-by: Frediano Ziglio <fredd...@gmail.com> --- block/qcow2-refcount.c | 5 +---- 1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index 2a915be..0f9a64a 100644 --- a/block/qcow2-refcount.c +++ b/block/qcow2-refcount.c @@ -140,10 +140,7 @@ static unsigned int next_refcount_table_size(BDRVQcowState *s, static int in_same_refcount_block(BDRVQcowState *s, uint64_t offset_a, uint64_t offset_b) { - uint64_t block_a = offset_a >> (2 * s->cluster_bits - REFCOUNT_SHIFT); - uint64_t block_b = offset_b >> (2 * s->cluster_bits - REFCOUNT_SHIFT); - - return (block_a == block_b); + return ((offset_a ^ offset_b) >> (2 * s->cluster_bits - REFCOUNT_SHIFT)) == 0; } /* -- 1.7.1