From patchwork Wed Oct 22 08:08:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Reitz X-Patchwork-Id: 401919 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8E4F214008B for ; Wed, 22 Oct 2014 19:13:43 +1100 (AEDT) Received: from localhost ([::1]:55381 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xgr37-0008M3-6U for incoming@patchwork.ozlabs.org; Wed, 22 Oct 2014 04:13:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xgqyf-0000vJ-II for qemu-devel@nongnu.org; Wed, 22 Oct 2014 04:09:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XgqyZ-00046e-DP for qemu-devel@nongnu.org; Wed, 22 Oct 2014 04:09:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XgqyZ-00046U-0I for qemu-devel@nongnu.org; Wed, 22 Oct 2014 04:08:59 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9M88uQL020178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 22 Oct 2014 04:08:56 -0400 Received: from localhost (dhcp-192-247.str.redhat.com [10.33.192.247]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9M88tMr024467 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Wed, 22 Oct 2014 04:08:56 -0400 From: Max Reitz To: qemu-devel@nongnu.org Date: Wed, 22 Oct 2014 10:08:36 +0200 Message-Id: <1413965324-14541-6-git-send-email-mreitz@redhat.com> In-Reply-To: <1413965324-14541-1-git-send-email-mreitz@redhat.com> References: <1413965324-14541-1-git-send-email-mreitz@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Kevin Wolf , =?UTF-8?q?Beno=C3=AEt=20Canet?= , Stefan Hajnoczi , Max Reitz Subject: [Qemu-devel] [PATCH v7 05/13] qcow2: Use sizeof(**refcount_table) X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- block/qcow2-refcount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c index e5f7876..e8b9df9 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,