aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2014-10-22 14:09:31 +0200
committerKevin Wolf <kwolf@redhat.com>2014-10-23 15:34:01 +0200
commit78fb328e854542d79bebe54f3a426cba6d46dbf1 (patch)
treee6f740f8dfbbe737ccd0689c0656d3a9a4d87710 /block
parent6ca56bf5e90aa167395727667d17c699950c545c (diff)
qcow2: Use sizeof(**refcount_table)
When implementing variable refcounts, we want to be able to easily find all the places in qemu which are tied to a certain refcount order. Replace sizeof(uint16_t) in the check code by sizeof(**refcount_table) so we can later find it more easily. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/qcow2-refcount.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index e5f7876957..e8b9df9306 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -1647,7 +1647,7 @@ static int check_refblocks(BlockDriverState *bs, BdrvCheckResult *res,
*nb_clusters);
memset(&(*refcount_table)[old_nb_clusters], 0,
(*nb_clusters - old_nb_clusters) *
- sizeof(uint16_t));
+ sizeof(**refcount_table));
}
(*refcount_table)[cluster]--;
inc_refcounts(bs, res, *refcount_table, *nb_clusters,