From: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-block@nongnu.org, vsementsov@yandex-team.ru,
jsnow@redhat.com, kwolf@redhat.com, hreitz@redhat.com,
qemu-devel@nongnu.org, andrey.drobyshev@virtuozzo.com,
den@virtuozzo.com
Subject: Re: [PATCH 2/4] hbitmap: introduce hbitmap_reverse()
Date: Wed, 21 May 2025 12:26:52 +0200 [thread overview]
Message-ID: <791949d4-8931-43e6-93fc-5e4ffcf1328e@virtuozzo.com> (raw)
In-Reply-To: <x6elam26xqiepon2bvrhpejczvia6ksqn4xviov5vhh7e7vfrc@yucgtxyeabe7>
On 5/20/25 18:29, Eric Blake wrote:
> [?? ??????? ????????? ?????? ?? eblake@redhat.com. ???????, ?????? ??? ?????, ?? ?????? https://aka.ms/LearnAboutSenderIdentification ]
>
> On Tue, May 13, 2025 at 03:32:36AM +0200, Andrey Zhadchenko wrote:
>> and bdrv_dirty_bitmap_reverse() helper
>
> Is 'inverse' a better name than 'reverse'?
Yeah, it sounds much better this way!
I will re-do the patchset
>
>>
>> Signed-off-by: Andrey Zhadchenko <andrey.zhadchenko@virtuozzo.com>
>> ---
>> +++ b/util/hbitmap.c
>> @@ -940,3 +940,18 @@ char *hbitmap_sha256(const HBitmap *bitmap, Error **errp)
>>
>> return hash;
>> }
>> +
>> +void hbitmap_reverse(HBitmap *bitmap)
>> +{
>> + int64_t pnum, pos = 0;
>> + int64_t size = bitmap->orig_size;
>> +
>> + while (pos < size) {
>> + if (hbitmap_status(bitmap, pos, size - pos, &pnum)) {
>> + hbitmap_reset(bitmap, pos, pnum);
>> + } else {
>> + hbitmap_set(bitmap, pos, pnum);
>> + }
>
> To me, reverse on 1110000 would be 0000111 (swapping the order); while
> inverse would be 0001111 (swapping the bits but preserving the order).
>
> The naming change will require respinning the series, but the concept
> makes sense.
> > --
> Eric Blake, Principal Software Engineer
> Red Hat, Inc.
> Virtualization: qemu.org | libguestfs.org
>
next prev parent reply other threads:[~2025-05-21 10:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-13 1:32 [PATCH 0/4] improve block_status() for cbw + snapshot setup Andrey Zhadchenko
2025-05-13 1:32 ` [PATCH 1/4] hbitmap: drop meta bitmap leftovers Andrey Zhadchenko
2025-05-20 16:27 ` Eric Blake
2025-05-13 1:32 ` [PATCH 2/4] hbitmap: introduce hbitmap_reverse() Andrey Zhadchenko
2025-05-20 16:29 ` Eric Blake
2025-05-21 10:26 ` Andrey Zhadchenko [this message]
2025-05-13 1:32 ` [PATCH 3/4] block/copy-before-write: reverse access bitmap Andrey Zhadchenko
2025-05-20 17:26 ` Eric Blake
2025-05-21 10:27 ` Andrey Zhadchenko
2025-05-13 1:32 ` [PATCH 4/4] block/copy-before-write: report partial block status to snapshot Andrey Zhadchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=791949d4-8931-43e6-93fc-5e4ffcf1328e@virtuozzo.com \
--to=andrey.zhadchenko@virtuozzo.com \
--cc=andrey.drobyshev@virtuozzo.com \
--cc=den@virtuozzo.com \
--cc=eblake@redhat.com \
--cc=hreitz@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@yandex-team.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).