From nobody Wed Nov 5 08:28:12 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1533318724325987.9532151149684; Fri, 3 Aug 2018 10:52:04 -0700 (PDT) Received: from localhost ([::1]:52541 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fleF9-000341-9u for importer@patchew.org; Fri, 03 Aug 2018 13:52:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fleAJ-00007Q-EW for qemu-devel@nongnu.org; Fri, 03 Aug 2018 13:47:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fleAE-0008Q8-Go for qemu-devel@nongnu.org; Fri, 03 Aug 2018 13:47:03 -0400 Received: from relay.sw.ru ([185.231.240.75]:42020) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fleAE-0008PT-82; Fri, 03 Aug 2018 13:46:58 -0400 Received: from vz-out.virtuozzo.com ([185.231.240.5] helo=kvm.sw.ru) by relay.sw.ru with esmtp (Exim 4.90_1) (envelope-from ) id 1fleAB-0003t9-ER; Fri, 03 Aug 2018 20:46:55 +0300 From: Vladimir Sementsov-Ogievskiy To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Fri, 3 Aug 2018 20:46:52 +0300 Message-Id: <20180803174654.278336-5-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.11.1 In-Reply-To: <20180803174654.278336-1-vsementsov@virtuozzo.com> References: <20180803174654.278336-1-vsementsov@virtuozzo.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH 4/6] Revert "block/dirty-bitmap: Add bdrv_dirty_iter_next_area" X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, vsementsov@virtuozzo.com, famz@redhat.com, jcody@redhat.com, mreitz@redhat.com, den@openvz.org, pbonzini@redhat.com, jsnow@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This reverts commit 72d10a94213a954ad569095cb4491f2ae0853c40. The function is unused now. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/dirty-bitmap.h | 2 -- block/dirty-bitmap.c | 55 ----------------------------------------= ---- 2 files changed, 57 deletions(-) diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h index c02be67564..3cab01eb4c 100644 --- a/include/block/dirty-bitmap.h +++ b/include/block/dirty-bitmap.h @@ -83,8 +83,6 @@ void bdrv_set_dirty_bitmap_locked(BdrvDirtyBitmap *bitmap, void bdrv_reset_dirty_bitmap_locked(BdrvDirtyBitmap *bitmap, int64_t offset, int64_t bytes); int64_t bdrv_dirty_iter_next(BdrvDirtyBitmapIter *iter); -bool bdrv_dirty_iter_next_area(BdrvDirtyBitmapIter *iter, uint64_t max_off= set, - uint64_t *offset, int *bytes); void bdrv_set_dirty_iter(BdrvDirtyBitmapIter *hbi, int64_t offset); int64_t bdrv_get_dirty_count(BdrvDirtyBitmap *bitmap); int64_t bdrv_get_meta_dirty_count(BdrvDirtyBitmap *bitmap); diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index c24aa0e229..35987e66a8 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -528,61 +528,6 @@ int64_t bdrv_dirty_iter_next(BdrvDirtyBitmapIter *iter) return hbitmap_iter_next(&iter->hbi, true); } =20 -/** - * Return the next consecutively dirty area in the dirty bitmap - * belonging to the given iterator @iter. - * - * @max_offset: Maximum value that may be returned for - * *offset + *bytes - * @offset: Will contain the start offset of the next dirty area - * @bytes: Will contain the length of the next dirty area - * - * Returns: True if a dirty area could be found before max_offset - * (which means that *offset and *bytes then contain valid - * values), false otherwise. - * - * Note that @iter is never advanced if false is returned. If an area - * is found (which means that true is returned), it will be advanced - * past that area. - */ -bool bdrv_dirty_iter_next_area(BdrvDirtyBitmapIter *iter, uint64_t max_off= set, - uint64_t *offset, int *bytes) -{ - uint32_t granularity =3D bdrv_dirty_bitmap_granularity(iter->bitmap); - uint64_t gran_max_offset; - int64_t ret; - int size; - - if (max_offset =3D=3D iter->bitmap->size) { - /* If max_offset points to the image end, round it up by the - * bitmap granularity */ - gran_max_offset =3D ROUND_UP(max_offset, granularity); - } else { - gran_max_offset =3D max_offset; - } - - ret =3D hbitmap_iter_next(&iter->hbi, false); - if (ret < 0 || ret + granularity > gran_max_offset) { - return false; - } - - *offset =3D ret; - size =3D 0; - - assert(granularity <=3D INT_MAX); - - do { - /* Advance iterator */ - ret =3D hbitmap_iter_next(&iter->hbi, true); - size +=3D granularity; - } while (ret + granularity <=3D gran_max_offset && - hbitmap_iter_next(&iter->hbi, false) =3D=3D ret + granularity= && - size <=3D INT_MAX - granularity); - - *bytes =3D MIN(size, max_offset - *offset); - return true; -} - /* Called within bdrv_dirty_bitmap_lock..unlock */ void bdrv_set_dirty_bitmap_locked(BdrvDirtyBitmap *bitmap, int64_t offset, int64_t bytes) --=20 2.11.1