qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]