qcow2: Use byte granularity in qcow2_alloc_cluster_offset()
authorKevin Wolf <kwolf@redhat.com>
Tue, 26 Mar 2013 16:50:10 +0000 (17:50 +0100)
committerStefan Hajnoczi <stefanha@redhat.com>
Thu, 28 Mar 2013 10:52:44 +0000 (11:52 +0100)
commit710c2496d8cecc92568d439a3cf9d5874b3a55e2
tree15e9db1345377706ae253de6e5d0fce6bc5339fa
parent411d62b04b4cd2d3a6cea310689dbafa2479bc28
qcow2: Use byte granularity in qcow2_alloc_cluster_offset()

This gets rid of the nb_clusters and keep_clusters and the associated
complicated calculations. Just advance the number of bytes that have
been processed and everything is fine.

This patch advances the variables even after the last operation even
though they aren't used any more afterwards to make things look more
uniform. A later patch will turn the whole thing into a loop and then
it actually starts making sense.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/qcow2-cluster.c