[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 17:02:08 +0100 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Wed 30 Oct 2019 01:04:02 PM CET, Max Reitz wrote:
> (I intended not to comment on such things on an RFC, but here I am...)
No problem with that :-)
> I’d call it host_cluster_offset to make clear that it points to a
> cluster and isn’t the host offset for @guest_offset.
Sure, why not. We can also accept the exact offset within the cluster
and then use start_of_cluster(), but I prefer this one.
> And now that I’ve gone this far already, I might as well say that I’d
> like if it the comment noted that this function not only creates the
> L2Meta structure but also adds it to the cluster_allocs list.
I'll update the comment.
>> + * @guest_offset and @bytes indicate the offset and length of the
>> + * request.
>> + *
>> + * If @keep_old is true it means that the clusters were already
>> + * allocated and will be overwritten. If false then the clusters are
>> + * new and we have to decrease the reference count of the old ones.
>> + */
>> +static void calculate_l2_meta(BlockDriverState *bs, uint64_t host_offset,
>> + uint64_t guest_offset, uint64_t bytes,
>
> And now I’m so deep into non-RFC-level review territory, I might as
> well say I’d prefer @bytes to be an unsigned (or maybe even a plain
> int), because anything more wouldn’t work. (Not least because
> cow_end_to is an unsigned).
True, I'll correct that too.
Thanks!
Berto
- [RFC PATCH v2 13/26] qcow2: Add subcluster support to calculate_l2_meta(), (continued)
- [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
- [RFC PATCH v2 12/26] qcow2: Handle QCOW2_CLUSTER_UNALLOCATED_SUBCLUSTER, Alberto Garcia, 2019/10/26
- [RFC PATCH v2 23/26] qcow2: Restrict qcow2_co_pwrite_zeroes() to full clusters only, Alberto Garcia, 2019/10/26