diff options
| author | Eric Blake | 2017-09-25 16:55:19 +0200 |
|---|---|---|
| committer | Kevin Wolf | 2017-10-06 16:28:58 +0200 |
| commit | 3b5d4df0c6b52746c6194bd2ea65828822db8438 (patch) | |
| tree | 8acbcd8f5f56e08fd2d80c26cfb26fe8f948a721 /include/block | |
| parent | dirty-bitmap: Change bdrv_get_dirty_count() to report bytes (diff) | |
| download | qemu-3b5d4df0c6b52746c6194bd2ea65828822db8438.tar.gz qemu-3b5d4df0c6b52746c6194bd2ea65828822db8438.tar.xz qemu-3b5d4df0c6b52746c6194bd2ea65828822db8438.zip | |
dirty-bitmap: Change bdrv_get_dirty_locked() to take bytes
Half the callers were already scaling bytes to sectors; the other
half can eventually be simplified to use byte iteration. Both
callers were already using the result as a bool, so make that
explicit. Making the change also makes it easier for a future
dirty-bitmap patch to offload scaling over to the internal hbitmap.
Remember, asking whether a byte is dirty is effectively asking
whether the entire granularity containing the byte is dirty, since
we only track dirtiness by granularity.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include/block')
| -rw-r--r-- | include/block/dirty-bitmap.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h index 757fc4c5b8..9e39537e4b 100644 --- a/include/block/dirty-bitmap.h +++ b/include/block/dirty-bitmap.h @@ -72,8 +72,8 @@ void bdrv_dirty_bitmap_set_persistance(BdrvDirtyBitmap *bitmap, /* Functions that require manual locking. */ void bdrv_dirty_bitmap_lock(BdrvDirtyBitmap *bitmap); void bdrv_dirty_bitmap_unlock(BdrvDirtyBitmap *bitmap); -int bdrv_get_dirty_locked(BlockDriverState *bs, BdrvDirtyBitmap *bitmap, - int64_t sector); +bool bdrv_get_dirty_locked(BlockDriverState *bs, BdrvDirtyBitmap *bitmap, + int64_t offset); void bdrv_set_dirty_bitmap_locked(BdrvDirtyBitmap *bitmap, int64_t cur_sector, int64_t nr_sectors); void bdrv_reset_dirty_bitmap_locked(BdrvDirtyBitmap *bitmap, |
