Eric Blake <ebl...@redhat.com> wrote: > Some of the callers were already scaling bytes to sectors; others > can be easily converted to pass byte offsets, all in our shift > towards a consistent byte interface everywhere. Making the change > will also make it easier to write the hold-out callers to use byte > rather than sectors for their iterations; it also makes it easier > for a future dirty-bitmap patch to offload scaling over to the > internal hbitmap. Although all callers happen to pass > sector-aligned values, make the internal scaling robust to any > sub-sector requests. > > Signed-off-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: John Snow <js...@redhat.com>
Reviewed-by: Juan Quintela <quint...@redhat.com> > + > assert(bdrv_dirty_bitmap_enabled(bitmap)); > - hbitmap_set(bitmap->bitmap, cur_sector, nr_sectors); > + hbitmap_set(bitmap->bitmap, offset >> BDRV_SECTOR_BITS, > + end_sector - (offset >> BDRV_SECTOR_BITS)); It is just me, or we use: bytes = sectors * BDRV_SECTOR_SIZE or bytes = sectors << BDRV_SECTOR_BITS and the same from bytes to sectors (no, this patch is consistent, but just looking at the file ....) Later, Juan.