Re: [Qemu-devel] [PATCH 3/3] COW: Skip setting already set bits

2013-11-06 Thread Charlie Shepherd
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: b

Re: [Qemu-devel] [PATCH 3/3] COW: Skip setting already set bits

2013-11-06 Thread Paolo Bonzini
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

[Qemu-devel] [PATCH 3/3] COW: Skip setting already set bits

2013-11-06 Thread Charlie Shepherd
Rather than unnecessarily setting bits that are already set, re-use cow_find_streak to find how many bits are already set for this sector, and only set unset bits. Do this before the flush to avoid it if no bits need to be set at all. Signed-off-by: Charlie Shepherd --- block/cow.c | 9 +++