[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 01/26] qcow2: Add calculate_l2_meta()
From: |
Alberto Garcia |
Subject: |
Re: [RFC PATCH v2 01/26] qcow2: Add calculate_l2_meta() |
Date: |
Wed, 30 Oct 2019 16:56:24 +0100 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Mon 28 Oct 2019 01:50:54 PM CET, Vladimir Sementsov-Ogievskiy wrote:
>> - .cow_end = {
>> - .offset = nb_bytes,
>
> hmm this logic is changed.. after the patch, it would be not nb_bytes, but
>
> offset_into_cluster(s, guest_offset) + MIN(*bytes, nb_bytes -
> offset_into_cluster(s, guest_offset))
It hasn't changed. The value of .cow_end.offset before the patch is
nb_bytes (these two lines are equivalent):
nb_bytes = MIN(requested_bytes, avail_bytes);
nb_bytes = MIN(*bytes + offset_into_cluster, avail_bytes);
After the patch we update *bytes to pass it to calculate_l2_meta(). Here
is the value (again, these are all equivalent):
*bytes = MIN(*bytes, nb_bytes - offset_into_cluster)
*bytes = MIN(*bytes, MIN(*bytes + offset_into_cluster, avail_bytes) -
offset_into_cluster)
*bytes = MIN(*bytes, MIN(*bytes, avail_bytes - offset_into_cluster))
*bytes = MIN(*bytes, avail_bytes - offset_into_cluster)
And here's the value of .cow_end.offset set in calculate_l2_meta():
cow_end_from = *bytes + offset_into_cluster
cow_end_from = MIN(*bytes, avail_bytes - offset_into_cluster) +
offset_into_cluster
cow_end_from = MIN(*bytes + offset_into_cluster, avail_bytes)
This last definition of cow_end_from is the same as nb_bytes as used
before the patch.
Berto
- [RFC PATCH v2 00/26] Add subcluster allocation to qcow2, Alberto Garcia, 2019/10/26
- [RFC PATCH v2 16/26] qcow2: Add subcluster support to discard_in_l2_slice(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 01/26] qcow2: Add calculate_l2_meta(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 25/26] qcow2: Allow preallocation and backing files if extended_l2 is set, Alberto Garcia, 2019/10/26
- [RFC PATCH v2 13/26] qcow2: Add subcluster support to calculate_l2_meta(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 21/26] qcow2: Clear the L2 bitmap when allocating a compressed cluster, Alberto Garcia, 2019/10/26
- [RFC PATCH v2 08/26] qcow2: Add offset_to_sc_index(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 06/26] qcow2: Add dummy has_subclusters() function, Alberto Garcia, 2019/10/26
- [RFC PATCH v2 10/26] qcow2: Update get/set_l2_entry() and add get/set_l2_bitmap(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 22/26] qcow2: Add subcluster support to handle_alloc_space(), Alberto Garcia, 2019/10/26