[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 09/24] qcow2: More helpers for refcount modif
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v6 09/24] qcow2: More helpers for refcount modification |
Date: |
Tue, 17 Feb 2015 14:38:12 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 10.02.2015 um 21:28 hat Max Reitz geschrieben:
> Add helper functions for getting and setting refcounts in a refcount
> array for any possible refcount order, and choose the correct one during
> refcount initialization.
>
> Signed-off-by: Max Reitz <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> Reviewed-by: Stefan Hajnoczi <address@hidden>
> ---
> block/qcow2-refcount.c | 121
> ++++++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 119 insertions(+), 2 deletions(-)
>
> diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
> index b9034ae..c9f9f4f 100644
> --- a/block/qcow2-refcount.c
> +++ b/block/qcow2-refcount.c
> @@ -32,10 +32,49 @@ static int QEMU_WARN_UNUSED_RESULT
> update_refcount(BlockDriverState *bs,
> int64_t offset, int64_t length, uint64_t addend,
> bool decrease, enum qcow2_discard_type type);
>
> +static uint64_t get_refcount_ro0(const void *refcount_array, uint64_t index);
> +static uint64_t get_refcount_ro1(const void *refcount_array, uint64_t index);
> +static uint64_t get_refcount_ro2(const void *refcount_array, uint64_t index);
> +static uint64_t get_refcount_ro3(const void *refcount_array, uint64_t index);
> static uint64_t get_refcount_ro4(const void *refcount_array, uint64_t index);
> +static uint64_t get_refcount_ro5(const void *refcount_array, uint64_t index);
> +static uint64_t get_refcount_ro6(const void *refcount_array, uint64_t index);
>
> +static void set_refcount_ro0(void *refcount_array, uint64_t index,
> + uint64_t value);
> +static void set_refcount_ro1(void *refcount_array, uint64_t index,
> + uint64_t value);
> +static void set_refcount_ro2(void *refcount_array, uint64_t index,
> + uint64_t value);
> +static void set_refcount_ro3(void *refcount_array, uint64_t index,
> + uint64_t value);
> static void set_refcount_ro4(void *refcount_array, uint64_t index,
> uint64_t value);
> +static void set_refcount_ro5(void *refcount_array, uint64_t index,
> + uint64_t value);
> +static void set_refcount_ro6(void *refcount_array, uint64_t index,
> + uint64_t value);
Hm, lots of forward declarations. Can't we put the implementation here?
Kevin
- Re: [Qemu-devel] [PATCH v6 05/24] qcow2: Use unsigned addend for update_refcount(), (continued)
- [Qemu-devel] [PATCH v6 06/24] qcow2: Use 64 bits for refcount values, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 10/24] qcow2: Open images with refcount order != 4, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 08/24] qcow2: Helper function for refcount modification, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 12/24] qcow2: Use symbolic macros in qcow2_amend_options, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 07/24] qcow2: Helper for refcount array reallocation, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 09/24] qcow2: More helpers for refcount modification, Max Reitz, 2015/02/10
- Re: [Qemu-devel] [PATCH v6 09/24] qcow2: More helpers for refcount modification,
Kevin Wolf <=
- [Qemu-devel] [PATCH v6 13/24] iotests: Prepare for refcount_bits option, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 15/24] progress: Allow regressing progress, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 11/24] qcow2: refcount_order parameter for qcow2_create2, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 20/24] qcow2: Use intermediate helper CB for amend, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 16/24] block: Add opaque value to the amend CB, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 14/24] qcow2: Allow creation with refcount order != 4, Max Reitz, 2015/02/10
- [Qemu-devel] [PATCH v6 17/24] qcow2: Use error_report() in qcow2_amend_options(), Max Reitz, 2015/02/10