qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC V6 07/33] qcow2: Add qcow2_dedup and related funct


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [RFC V6 07/33] qcow2: Add qcow2_dedup and related functions
Date: Wed, 6 Feb 2013 22:19:20 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Feb 06, 2013 at 01:31:40PM +0100, Benoît Canet wrote:
> +/* Deduplicate all the cluster that can be deduplicated.
> + *
> + * Next it compute the number of non deduplicable sectors to come while 
> storing

s/compute/computes/

> + * the hashes of these sectors in a linked list for later usage.
> + * Then it compute the first duplicated cluster hash that come after non

s/compute/computes/
s/come/comes/

> + * deduplicable cluster, this hash will be used at next call of the function
> + *
> + * @ds:              a structure containing the state of the deduplication
> + *                   for this write request
> + * @sector_num:      The logical sector
> + * @data:            the buffer containing the data to deduplicate
> + * @data_nr:         the size of the buffer in sectors
> + *
> + */
> +int qcow2_dedup(BlockDriverState *bs,
> +                QCowDedupState *ds,
> +                uint64_t sector_num,
> +                uint8_t *data,
> +                int data_nr)
> +{
> +    BDRVQcowState *s = bs->opaque;
> +    int ret = 0;
> +    int deduped_clusters_nr = 0;
> +    int left_to_process;
> +    int begining_index;
> +
> +    begining_index = sector_num & (s->cluster_sectors - 1);

s/begining/beginning/ but start_index would be shorter.

> +
> +    left_to_process = (data_nr / s->cluster_sectors) -
> +                      ds->nb_clusters_processed;

data_nr must be a multiple of cluster_sectors?



reply via email to

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