diff options
author | Alberto Garcia <berto@igalia.com> | 2020-07-10 18:12:57 +0200 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2020-08-25 08:33:20 +0200 |
commit | 70d1cbae03b54995fdc99f9934c847a87125e4f5 (patch) | |
tree | 9276c1d9dd5519569ee3f4331610665d90e983c0 /block/qcow2.h | |
parent | 34905d8eb1ef788a41a490cb1602582ff78cb6f4 (diff) |
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>
Diffstat (limited to 'block/qcow2.h')
0 files changed, 0 insertions, 0 deletions