|
|
7711c0 |
From 4ff0b9ce2eca5f96d7c99b0d95bafdfae917958f Mon Sep 17 00:00:00 2001
|
|
|
7711c0 |
From: John Snow <jsnow@redhat.com>
|
|
|
7711c0 |
Date: Wed, 20 Mar 2019 21:48:33 +0100
|
|
|
7711c0 |
Subject: [PATCH 040/163] Revert "block/dirty-bitmap: Add
|
|
|
7711c0 |
bdrv_dirty_iter_next_area"
|
|
|
7711c0 |
|
|
|
7711c0 |
RH-Author: John Snow <jsnow@redhat.com>
|
|
|
7711c0 |
Message-id: <20190320214838.22027-6-jsnow@redhat.com>
|
|
|
7711c0 |
Patchwork-id: 84997
|
|
|
7711c0 |
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH 05/10] Revert "block/dirty-bitmap: Add bdrv_dirty_iter_next_area"
|
|
|
7711c0 |
Bugzilla: 1691048
|
|
|
7711c0 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: Max Reitz <mreitz@redhat.com>
|
|
|
7711c0 |
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
7711c0 |
|
|
|
7711c0 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
|
|
|
7711c0 |
|
|
|
7711c0 |
This reverts commit 72d10a94213a954ad569095cb4491f2ae0853c40.
|
|
|
7711c0 |
|
|
|
7711c0 |
The function is unused now.
|
|
|
7711c0 |
|
|
|
7711c0 |
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
|
|
|
7711c0 |
Reviewed-by: John Snow <jsnow@redhat.com>
|
|
|
7711c0 |
(cherry picked from commit 166cd551254f4ea6226d7e687b19928747247500)
|
|
|
7711c0 |
Signed-off-by: John Snow <jsnow@redhat.com>
|
|
|
7711c0 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
7711c0 |
---
|
|
|
7711c0 |
block/dirty-bitmap.c | 55 --------------------------------------------
|
|
|
7711c0 |
include/block/dirty-bitmap.h | 2 --
|
|
|
7711c0 |
2 files changed, 57 deletions(-)
|
|
|
7711c0 |
|
|
|
7711c0 |
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
|
|
|
7711c0 |
index c151837..4d9a8af 100644
|
|
|
7711c0 |
--- a/block/dirty-bitmap.c
|
|
|
7711c0 |
+++ b/block/dirty-bitmap.c
|
|
|
7711c0 |
@@ -518,61 +518,6 @@ int64_t bdrv_dirty_iter_next(BdrvDirtyBitmapIter *iter)
|
|
|
7711c0 |
return hbitmap_iter_next(&iter->hbi, true);
|
|
|
7711c0 |
}
|
|
|
7711c0 |
|
|
|
7711c0 |
-/**
|
|
|
7711c0 |
- * Return the next consecutively dirty area in the dirty bitmap
|
|
|
7711c0 |
- * belonging to the given iterator @iter.
|
|
|
7711c0 |
- *
|
|
|
7711c0 |
- * @max_offset: Maximum value that may be returned for
|
|
|
7711c0 |
- * *offset + *bytes
|
|
|
7711c0 |
- * @offset: Will contain the start offset of the next dirty area
|
|
|
7711c0 |
- * @bytes: Will contain the length of the next dirty area
|
|
|
7711c0 |
- *
|
|
|
7711c0 |
- * Returns: True if a dirty area could be found before max_offset
|
|
|
7711c0 |
- * (which means that *offset and *bytes then contain valid
|
|
|
7711c0 |
- * values), false otherwise.
|
|
|
7711c0 |
- *
|
|
|
7711c0 |
- * Note that @iter is never advanced if false is returned. If an area
|
|
|
7711c0 |
- * is found (which means that true is returned), it will be advanced
|
|
|
7711c0 |
- * past that area.
|
|
|
7711c0 |
- */
|
|
|
7711c0 |
-bool bdrv_dirty_iter_next_area(BdrvDirtyBitmapIter *iter, uint64_t max_offset,
|
|
|
7711c0 |
- uint64_t *offset, int *bytes)
|
|
|
7711c0 |
-{
|
|
|
7711c0 |
- uint32_t granularity = bdrv_dirty_bitmap_granularity(iter->bitmap);
|
|
|
7711c0 |
- uint64_t gran_max_offset;
|
|
|
7711c0 |
- int64_t ret;
|
|
|
7711c0 |
- int size;
|
|
|
7711c0 |
-
|
|
|
7711c0 |
- if (max_offset == iter->bitmap->size) {
|
|
|
7711c0 |
- /* If max_offset points to the image end, round it up by the
|
|
|
7711c0 |
- * bitmap granularity */
|
|
|
7711c0 |
- gran_max_offset = ROUND_UP(max_offset, granularity);
|
|
|
7711c0 |
- } else {
|
|
|
7711c0 |
- gran_max_offset = max_offset;
|
|
|
7711c0 |
- }
|
|
|
7711c0 |
-
|
|
|
7711c0 |
- ret = hbitmap_iter_next(&iter->hbi, false);
|
|
|
7711c0 |
- if (ret < 0 || ret + granularity > gran_max_offset) {
|
|
|
7711c0 |
- return false;
|
|
|
7711c0 |
- }
|
|
|
7711c0 |
-
|
|
|
7711c0 |
- *offset = ret;
|
|
|
7711c0 |
- size = 0;
|
|
|
7711c0 |
-
|
|
|
7711c0 |
- assert(granularity <= INT_MAX);
|
|
|
7711c0 |
-
|
|
|
7711c0 |
- do {
|
|
|
7711c0 |
- /* Advance iterator */
|
|
|
7711c0 |
- ret = hbitmap_iter_next(&iter->hbi, true);
|
|
|
7711c0 |
- size += granularity;
|
|
|
7711c0 |
- } while (ret + granularity <= gran_max_offset &&
|
|
|
7711c0 |
- hbitmap_iter_next(&iter->hbi, false) == ret + granularity &&
|
|
|
7711c0 |
- size <= INT_MAX - granularity);
|
|
|
7711c0 |
-
|
|
|
7711c0 |
- *bytes = MIN(size, max_offset - *offset);
|
|
|
7711c0 |
- return true;
|
|
|
7711c0 |
-}
|
|
|
7711c0 |
-
|
|
|
7711c0 |
/* Called within bdrv_dirty_bitmap_lock..unlock */
|
|
|
7711c0 |
void bdrv_set_dirty_bitmap_locked(BdrvDirtyBitmap *bitmap,
|
|
|
7711c0 |
int64_t offset, int64_t bytes)
|
|
|
7711c0 |
diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h
|
|
|
7711c0 |
index 4ef00ca..04a117f 100644
|
|
|
7711c0 |
--- a/include/block/dirty-bitmap.h
|
|
|
7711c0 |
+++ b/include/block/dirty-bitmap.h
|
|
|
7711c0 |
@@ -83,8 +83,6 @@ void bdrv_set_dirty_bitmap_locked(BdrvDirtyBitmap *bitmap,
|
|
|
7711c0 |
void bdrv_reset_dirty_bitmap_locked(BdrvDirtyBitmap *bitmap,
|
|
|
7711c0 |
int64_t offset, int64_t bytes);
|
|
|
7711c0 |
int64_t bdrv_dirty_iter_next(BdrvDirtyBitmapIter *iter);
|
|
|
7711c0 |
-bool bdrv_dirty_iter_next_area(BdrvDirtyBitmapIter *iter, uint64_t max_offset,
|
|
|
7711c0 |
- uint64_t *offset, int *bytes);
|
|
|
7711c0 |
void bdrv_set_dirty_iter(BdrvDirtyBitmapIter *hbi, int64_t offset);
|
|
|
7711c0 |
int64_t bdrv_get_dirty_count(BdrvDirtyBitmap *bitmap);
|
|
|
7711c0 |
int64_t bdrv_get_meta_dirty_count(BdrvDirtyBitmap *bitmap);
|
|
|
7711c0 |
--
|
|
|
7711c0 |
1.8.3.1
|
|
|
7711c0 |
|