[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 21/26] qcow2: Clear the L2 bitmap when allocating a compressed cluster, (continued)
- [RFC PATCH v2 21/26] qcow2: Clear the L2 bitmap when allocating a compressed cluster, 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 08/26] qcow2: Add offset_to_sc_index(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 14/26] qcow2: Add subcluster support to qcow2_get_cluster_offset(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 06/26] qcow2: Add dummy has_subclusters() function, Alberto Garcia, 2019/10/26
- [RFC PATCH v2 05/26] qcow2: Document the Extended L2 Entries feature, Alberto Garcia, 2019/10/26
- [RFC PATCH v2 01/26] qcow2: Add calculate_l2_meta(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 15/26] qcow2: Add subcluster support to zero_in_l2_slice(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 07/26] qcow2: Add subcluster-related fields to BDRVQcow2State, Alberto Garcia, 2019/10/26
- [RFC PATCH v2 09/26] qcow2: Add l2_entry_size(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 17/26] qcow2: Add subcluster support to check_refcounts_l2(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 02/26] qcow2: Split cluster_needs_cow() out of count_cow_clusters(), Alberto Garcia, 2019/10/26
- [RFC PATCH v2 20/26] qcow2: Update L2 bitmap in qcow2_alloc_cluster_link_l2(), Alberto Garcia, 2019/10/26