[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v5 2/2] vmdk: Optimize cluster allocation
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v5 2/2] vmdk: Optimize cluster allocation |
Date: |
Mon, 28 Jul 2014 16:11:10 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Tue, May 27, 2014 at 04:49:22PM +0800, Fam Zheng wrote:
> + if (!bs->backing_hd) {
> + memset(whole_grain, 0, skip_start_sector << BDRV_SECTOR_BITS);
> + memset(whole_grain + (skip_end_sector << BDRV_SECTOR_BITS), 0,
> + cluster_bytes - (skip_end_sector << BDRV_SECTOR_BITS));
> + }
> +
> + assert(skip_end_sector <= sector_num + extent->cluster_sectors);
Does this assertion make sense? skip_end_sector is a small number of
sectors (relative to start of cluster), while sector_num +
extent->cluster_sectors is a large absolute sector offset.
> +/**
> + * get_cluster_offset
> + *
> + * Look up cluster offset in extent file by sector number, and store in
> + * @cluster_offset.
> + *
> + * For flat extent, the start offset as parsed from the description file is
s/extent/extents/
> + * returned.
> + *
> + * For sparse extent, look up in L1, L2 table. If allocate is true, return an
s/extent/extents/
> + * offset for a new cluster and update L2 cache. If there is a backing file,
> + * COW is done before returning; otherwise, zeroes are written to the
> allocated
> + * cluster. Both COW and zero writting skips the sector range
s/writting/writing/
pgpPd5G9bki7s.pgp
Description: PGP signature
- Re: [Qemu-devel] [PATCH v5 2/2] vmdk: Optimize cluster allocation,
Stefan Hajnoczi <=