qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 19/30] qcow2: Add subcluster support to zero_in_l2_slice()


From: Alberto Garcia
Subject: Re: [PATCH v4 19/30] qcow2: Add subcluster support to zero_in_l2_slice()
Date: Wed, 22 Apr 2020 14:53:48 +0200
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Wed 22 Apr 2020 01:06:42 PM CEST, Vladimir Sementsov-Ogievskiy wrote:
>> @@ -1897,7 +1897,7 @@ static int zero_in_l2_slice(BlockDriverState *bs, 
>> uint64_t offset,
>
> As I see, function is not prepared to handle unaligned offset. Worth
> add an assertion while being here?

The only caller already asserts that, and the length parameter is not
even the number of bytes but the number of clusters, so I don't think
it's so important in this case.

>>       for (i = 0; i < nb_clusters; i++) {
>> -        uint64_t old_offset;
>> +        uint64_t old_offset, l2_entry = 0;
>
> I'd rename s/old_offset/old_l2_entry

I think we can get rid of old_offset altogether. I'll think of a way to
restructure the logics along the lines that you suggest.

Thanks!

Berto



reply via email to

[Prev in Thread] Current Thread [Next in Thread]