]> www.infradead.org Git - users/dwmw2/qemu.git/commit
qcow2: Add subcluster support to qcow2_get_host_offset()
authorAlberto Garcia <berto@igalia.com>
Fri, 10 Jul 2020 16:13:03 +0000 (18:13 +0200)
committerMax Reitz <mreitz@redhat.com>
Tue, 25 Aug 2020 06:33:20 +0000 (08:33 +0200)
commit3f9c6b3b1f48d6c59d27df658f03792b857d7b55
tree3cd3571e0b384f5535ca24398ea8ae032e3f0fda
parentd53ec3d8d8e12d5a7c7f48347be450af56040b1a
qcow2: Add subcluster support to qcow2_get_host_offset()

The logic of this function remains pretty much the same, except that
it uses count_contiguous_subclusters(), which combines the logic of
count_contiguous_clusters() / count_contiguous_clusters_unallocated()
and checks individual subclusters.

qcow2_cluster_to_subcluster_type() is not necessary as a separate
function anymore so it's inlined into its caller.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <d2193fd48653a350d80f0eca1c67b1d9053fb2f3.1594396418.git.berto@igalia.com>
[mreitz: Initialize expected_type to anything]
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/qcow2-cluster.c
block/qcow2.h