[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v10 02/34] qcow2: Convert qcow2_get_cluster_offset() into qco
From: |
Max Reitz |
Subject: |
Re: [PATCH v10 02/34] qcow2: Convert qcow2_get_cluster_offset() into qcow2_get_host_offset() |
Date: |
Thu, 9 Jul 2020 12:13:45 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 |
On 03.07.20 17:57, Alberto Garcia wrote:
> qcow2_get_cluster_offset() takes an (unaligned) guest offset and
> returns the (aligned) offset of the corresponding cluster in the qcow2
> image.
>
> In practice none of the callers need to know where the cluster starts
> so this patch makes the function calculate and return the final host
> offset directly. The function is also renamed accordingly.
>
> There is a pre-existing exception with compressed clusters: in this
> case the function returns the complete cluster descriptor (containing
> the offset and size of the compressed data). This does not change with
> this patch but it is now documented.
>
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
> block/qcow2.h | 4 ++--
> block/qcow2-cluster.c | 41 +++++++++++++++++++++++------------------
> block/qcow2.c | 24 +++++++-----------------
> 3 files changed, 32 insertions(+), 37 deletions(-)
Reviewed-by: Max Reitz <mreitz@redhat.com>
signature.asc
Description: OpenPGP digital signature
- [PATCH v10 00/34] Add subcluster allocation to qcow2, Alberto Garcia, 2020/07/03
- [PATCH v10 03/34] qcow2: Add calculate_l2_meta(), Alberto Garcia, 2020/07/03
- [PATCH v10 06/34] qcow2: Add get_l2_entry() and set_l2_entry(), Alberto Garcia, 2020/07/03
- [PATCH v10 08/34] qcow2: Add dummy has_subclusters() function, Alberto Garcia, 2020/07/03
- [PATCH v10 09/34] qcow2: Add subcluster-related fields to BDRVQcow2State, Alberto Garcia, 2020/07/03
- [PATCH v10 07/34] qcow2: Document the Extended L2 Entries feature, Alberto Garcia, 2020/07/03
- [PATCH v10 05/34] qcow2: Process QCOW2_CLUSTER_ZERO_ALLOC clusters in handle_copied(), Alberto Garcia, 2020/07/03
- [PATCH v10 01/34] qcow2: Make Qcow2AioTask store the full host offset, Alberto Garcia, 2020/07/03
- [PATCH v10 02/34] qcow2: Convert qcow2_get_cluster_offset() into qcow2_get_host_offset(), Alberto Garcia, 2020/07/03
- Re: [PATCH v10 02/34] qcow2: Convert qcow2_get_cluster_offset() into qcow2_get_host_offset(),
Max Reitz <=
- [PATCH v10 04/34] qcow2: Split cluster_needs_cow() out of count_cow_clusters(), Alberto Garcia, 2020/07/03
- [PATCH v10 11/34] qcow2: Add offset_into_subcluster() and size_to_subclusters(), Alberto Garcia, 2020/07/03
- [PATCH v10 12/34] qcow2: Add l2_entry_size(), Alberto Garcia, 2020/07/03
- [PATCH v10 10/34] qcow2: Add offset_to_sc_index(), Alberto Garcia, 2020/07/03
- [PATCH v10 16/34] qcow2: Add qcow2_cluster_is_allocated(), Alberto Garcia, 2020/07/03
- [PATCH v10 15/34] qcow2: Add qcow2_get_subcluster_range_type(), Alberto Garcia, 2020/07/03
- [PATCH v10 21/34] qcow2: Add subcluster support to qcow2_get_host_offset(), Alberto Garcia, 2020/07/03
- [PATCH v10 25/34] qcow2: Update L2 bitmap in qcow2_alloc_cluster_link_l2(), Alberto Garcia, 2020/07/03
- [PATCH v10 18/34] qcow2: Replace QCOW2_CLUSTER_* with QCOW2_SUBCLUSTER_*, Alberto Garcia, 2020/07/03