qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [PATCH v2 02/32] qcow2: Add table size fie


From: Alberto Garcia
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v2 02/32] qcow2: Add table size field to Qcow2Cache
Date: Wed, 17 Jan 2018 13:54:13 +0100
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Tue 16 Jan 2018 10:05:08 PM CET, Eric Blake wrote:
>> @@ -331,7 +330,7 @@ static int qcow2_cache_do_get(BlockDriverState *bs, 
>> Qcow2Cache *c,
>>      trace_qcow2_cache_get(qemu_coroutine_self(), c == s->l2_table_cache,
>>                            offset, read_from_disk);
>>  
>> -    if (offset_into_cluster(s, offset)) {
>> +    if (offset & (c->table_size - 1)) {
>
> Worth writing that as QEMU_IS_ALIGNED(offset, c->table_size) instead
> of open-coding the bit-wise math?

Oh, indeed, I very much prefer using macros/functions instead of dealing
with bits directly. I'll change it for the next revision.

Berto



reply via email to

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