[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 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
- [RFC PATCH v2 05/26] qcow2: Document the Extended L2 Entries feature, Alberto Garcia, 2019/10/26