On 21/08/2013 09:14, Paolo Bonzini wrote:
Il 21/08/2013 00:53, Charlie Shepherd ha scritto:
What if nb_sectors > 512 * 8?
For cow_co_is_allocated, you have the luxury of returning information
only for the fewer than nb_sectors. That is, you can set *num_same to a
smaller value than nb_sectors, even if sector_num + *num_same has the
same state as the [sector_num, sector_num + *num_same) range. It will
cause extra calls to is_allocated in the callers, but that's it.
So we can report a conservative estimate of *num_same? It still seems
worthwhile to me to be as efficient as possible, I guess that means
processing a sector's worth of metadata at a time?
Charlie