|
From: | Charlie Shepherd |
Subject: | Re: [Qemu-devel] [PATCH 3/3] COW: Skip setting already set bits |
Date: | Wed, 06 Nov 2013 12:36:04 +0000 |
User-agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 |
On 06/11/2013 12:29, Paolo Bonzini wrote:
Il 06/11/2013 13:23, Charlie Shepherd ha scritto:+ set = cow_find_streak(bitmap, 1, bitnum, sector_bits); + if (set == sector_bits) { + continue;I think this shouldn't be a continue; these lines should be executed: bitnum += sector_bits; nb_sectors -= sector_bits; offset += BDRV_SECTOR_SIZE;
Good point, this is basically a poor man's for-loop. I'll turn it into a for loop then continue will make sense here.
+ } + bitnum += set;Here you're adjusting bitnum but not nb_sectors and sector_bits.
Good catch. Charlie
[Prev in Thread] | Current Thread | [Next in Thread] |