summary refs log tree commit diff stats
path: root/include/qemu/hbitmap.h
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2019-01-15 18:26:49 -0500
committerJohn Snow <jsnow@redhat.com>2019-01-15 18:26:49 -0500
commit76d570dc495c56bbdcc4574bfc6d512dcb8e9aa9 (patch)
tree80b114f05c7c9f30dcd1655cfa50c1f1330572d2 /include/qemu/hbitmap.h
parent4b9f0b0f7c84eea2dfb0d5be3e0254bc91319dbc (diff)
downloadfocaccia-qemu-76d570dc495c56bbdcc4574bfc6d512dcb8e9aa9.tar.gz
focaccia-qemu-76d570dc495c56bbdcc4574bfc6d512dcb8e9aa9.zip
dirty-bitmap: improve bdrv_dirty_bitmap_next_zero
Add bytes parameter to the function, to limit searched range.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Diffstat (limited to 'include/qemu/hbitmap.h')
-rw-r--r--include/qemu/hbitmap.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/qemu/hbitmap.h b/include/qemu/hbitmap.h
index a7cb780592..135975530f 100644
--- a/include/qemu/hbitmap.h
+++ b/include/qemu/hbitmap.h
@@ -300,12 +300,16 @@ void hbitmap_iter_init(HBitmapIter *hbi, const HBitmap *hb, uint64_t first);
 unsigned long hbitmap_iter_skip_words(HBitmapIter *hbi);
 
 /* hbitmap_next_zero:
+ *
+ * Find next not dirty bit within selected range. If not found, return -1.
+ *
  * @hb: The HBitmap to operate on
  * @start: The bit to start from.
- *
- * Find next not dirty bit.
+ * @count: Number of bits to proceed. If @start+@count > bitmap size, the whole
+ * bitmap is looked through. You can use UINT64_MAX as @count to search up to
+ * the bitmap end.
  */
-int64_t hbitmap_next_zero(const HBitmap *hb, uint64_t start);
+int64_t hbitmap_next_zero(const HBitmap *hb, uint64_t start, uint64_t count);
 
 /* hbitmap_create_meta:
  * Create a "meta" hbitmap to track dirtiness of the bits in this HBitmap.