[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 10/10] block/qcow2-bitmap: use bdrv_dirty_bitmap_next_dirt
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
Re: [PATCH v3 10/10] block/qcow2-bitmap: use bdrv_dirty_bitmap_next_dirty |
Date: |
Mon, 20 Jan 2020 16:05:09 +0000 |
20.01.2020 17:18, Max Reitz wrote:
> On 19.12.19 11:03, Vladimir Sementsov-Ogievskiy wrote:
>> store_bitmap_data() loop does bdrv_set_dirty_iter() on each iteration,
>> which means that we actually don't need iterator itself and we can use
>> simpler bitmap API.
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
>> ---
>> block/qcow2-bitmap.c | 11 +++++------
>> 1 file changed, 5 insertions(+), 6 deletions(-)
>>
>> diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
>> index c6c8ebbe89..015f5d18d2 100644
>> --- a/block/qcow2-bitmap.c
>> +++ b/block/qcow2-bitmap.c
>
> [...]
>
>> @@ -1360,19 +1361,17 @@ static uint64_t *store_bitmap_data(BlockDriverState
>> *bs,
>
> (One line more context:)
>
>> if (end >= bm_size)
>> break;
>> }
>
> Can we drop this now?
Yes, we can, as hbitmap_next_dirty returns -1 in this case.
>
> If so, and with that done:
>
> Reviewed-by: Max Reitz <address@hidden>
>
>>
>> - bdrv_set_dirty_iter(dbi, end);
>> + offset = end;
>> }
>
--
Best regards,
Vladimir