Searched hist:"70 d1cbae" (Results 1 – 1 of 1) sorted by relevance
/qemu/block/ |
H A D | qcow2-cluster.c | 70d1cbae Fri Jul 10 16:12:57 GMT 2020 Alberto Garcia <berto@igalia.com> qcow2: Add qcow2_get_subcluster_range_type()
There are situations in which we want to know how many contiguous subclusters of the same type there are in a given cluster. This can be done by simply iterating over the subclusters and repeatedly calling qcow2_get_subcluster_type() for each one of them.
However once we determined the type of a subcluster we can check the rest efficiently by counting the number of adjacent ones (or zeroes) in the bitmap. This is what this function does.
Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-Id: <db917263d568ec6ffb4a41cac3c9100f96bf6c18.1594396418.git.berto@igalia.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
|