[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 27/39] qcow2: Simplify calculation for COW area at t
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 27/39] qcow2: Simplify calculation for COW area at the end |
Date: |
Fri, 15 Jun 2012 15:33:27 +0200 |
copy_sectors() always uses the sum (cluster_offset + n_start) or
(start_sect + n_start), so if some value is added to both cluster_offset
and start_sect, and subtracted from n_start, it's cancelled out anyway.
Signed-off-by: Kevin Wolf <address@hidden>
---
block/qcow2-cluster.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 4eb5ba7..98fba71 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -642,11 +642,10 @@ int qcow2_alloc_cluster_link_l2(BlockDriverState *bs,
QCowL2Meta *m)
}
if (m->nb_available & (s->cluster_sectors - 1)) {
- uint64_t end = m->nb_available & ~(uint64_t)(s->cluster_sectors - 1);
cow = true;
qemu_co_mutex_unlock(&s->lock);
- ret = copy_sectors(bs, start_sect + end, cluster_offset + (end << 9),
- m->nb_available - end, s->cluster_sectors);
+ ret = copy_sectors(bs, start_sect, cluster_offset, m->nb_available,
+ align_offset(m->nb_available, s->cluster_sectors));
qemu_co_mutex_lock(&s->lock);
if (ret < 0)
goto err;
--
1.7.6.5
- [Qemu-devel] [PATCH 31/39] qemu-img: document qed format on qemu-img man page, (continued)
- [Qemu-devel] [PATCH 31/39] qemu-img: document qed format on qemu-img man page, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 35/39] qcow2: fix autoclear image header update, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 37/39] fdc-test: introduced qtest read_without_media, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 28/39] qcow2: Fix avail_sectors in cluster allocation code, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 24/39] block: always open drivers in writeback mode, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 33/39] xen: Don't change -drive if=xen device name during machine init, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 29/39] qemu-iotests: Some backing file COW tests, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 26/39] qcow2: always operate caches in writeback mode, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 32/39] block: Replace bdrv_get_format() by bdrv_get_format_name(), Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 34/39] xen: Don't peek behind the BlockDriverState abstraction, Kevin Wolf, 2012/06/15
- [Qemu-devel] [PATCH 27/39] qcow2: Simplify calculation for COW area at the end,
Kevin Wolf <=
- Re: [Qemu-devel] [PULL 00/39] Block patches, Anthony Liguori, 2012/06/20