[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qcow2: Simplify calculation for COW area at the
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] qcow2: Simplify calculation for COW area at the end |
Date: |
Tue, 12 Jun 2012 16:39:11 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
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