summaryrefslogtreecommitdiff
path: root/block/qcow2-cluster.c
diff options
context:
space:
mode:
authorHu Tao <hutao@cn.fujitsu.com>2013-12-05 14:32:34 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2013-12-06 16:53:50 +0100
commitac95acdb8e0876fa489bd31a48e8ecd6ef901d67 (patch)
tree171e10ba16ec167cbb80fd3cb2750e3b857712af /block/qcow2-cluster.c
parent405889820bcd5c2abf4eb70598e96f525f862c0f (diff)
downloadqemu-ac95acdb8e0876fa489bd31a48e8ecd6ef901d67.tar.gz
qcow2: use start_of_cluster() and offset_into_cluster() everywhere
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/qcow2-cluster.c')
-rw-r--r--block/qcow2-cluster.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 11f9c50aa7..853408438a 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -1401,7 +1401,7 @@ int qcow2_discard_clusters(BlockDriverState *bs, uint64_t offset,
/* Round start up and end down */
offset = align_offset(offset, s->cluster_size);
- end_offset &= ~(s->cluster_size - 1);
+ end_offset = start_of_cluster(s, end_offset);
if (offset > end_offset) {
return 0;