From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeSFg-0001ka-Nm for qemu-devel@nongnu.org; Tue, 12 Jun 2012 10:39:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SeSFX-00084x-NG for qemu-devel@nongnu.org; Tue, 12 Jun 2012 10:39:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54337) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SeSFX-000847-F9 for qemu-devel@nongnu.org; Tue, 12 Jun 2012 10:39:15 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5CEdDTB006616 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 12 Jun 2012 10:39:13 -0400 Message-ID: <4FD7548F.80301@redhat.com> Date: Tue, 12 Jun 2012 16:39:11 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1339508835-15108-1-git-send-email-kwolf@redhat.com> <4FD74B8D.9090800@redhat.com> <4FD7506C.1030606@redhat.com> <4FD752AA.6000705@redhat.com> <4FD75430.3090902@redhat.com> In-Reply-To: <4FD75430.3090902@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qcow2: Simplify calculation for COW area at the end List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org Il 12/06/2012 16:37, Kevin Wolf ha scritto: >> > align_offset(m->nb_available+1, s->cluster_sectors) > Heh, yes, you're thinking about equivalence of the very formula (which > is what I would do in unknown code as well), whereas I think about a COW > operation that ranges from a given sector to the end of the same cluster > (and not the next one). > > It's eventually the same, because this statement is only executed when > it's not aligned (i.e. the COW range isn't empty): > > if (m->nb_available & (s->cluster_sectors - 1)) { > ... > } Indeed, your version is ok. Paolo