[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 09/12] dirty-bitmap: Change bdrv_[re]set_dirt
From: |
Juan Quintela |
Subject: |
Re: [Qemu-devel] [PATCH v2 09/12] dirty-bitmap: Change bdrv_[re]set_dirty_bitmap() to use bytes |
Date: |
Wed, 17 May 2017 13:59:23 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Eric Blake <address@hidden> 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 <address@hidden>
> Reviewed-by: John Snow <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
> +
> 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.
- [Qemu-devel] [PATCH v2 03/12] dirty-bitmap: Drop unused functions, (continued)
- [Qemu-devel] [PATCH v2 03/12] dirty-bitmap: Drop unused functions, Eric Blake, 2017/05/16
- [Qemu-devel] [PATCH v2 04/12] dirty-bitmap: Track size in bytes, Eric Blake, 2017/05/16
- [Qemu-devel] [PATCH v2 05/12] dirty-bitmap: Set iterator start by offset, not sector, Eric Blake, 2017/05/16
- [Qemu-devel] [PATCH v2 06/12] dirty-bitmap: Change bdrv_dirty_iter_next() to report byte offset, Eric Blake, 2017/05/16
- [Qemu-devel] [PATCH v2 07/12] dirty-bitmap: Change bdrv_get_dirty_count() to report bytes, Eric Blake, 2017/05/16
- [Qemu-devel] [PATCH v2 08/12] dirty-bitmap: Change bdrv_get_dirty() to take bytes, Eric Blake, 2017/05/16
- [Qemu-devel] [PATCH v2 11/12] dirty-bitmap: Switch bdrv_set_dirty() to bytes, Eric Blake, 2017/05/16
- [Qemu-devel] [PATCH v2 09/12] dirty-bitmap: Change bdrv_[re]set_dirty_bitmap() to use bytes, Eric Blake, 2017/05/16
- Re: [Qemu-devel] [PATCH v2 09/12] dirty-bitmap: Change bdrv_[re]set_dirty_bitmap() to use bytes,
Juan Quintela <=
- [Qemu-devel] [PATCH v2 10/12] mirror: Switch mirror_dirty_init() to byte-based iteration, Eric Blake, 2017/05/16
- [Qemu-devel] [PATCH v2 12/12] dirty-bitmap: Convert internal hbitmap size/granularity, Eric Blake, 2017/05/16