qcow2: Update get/set_l2_entry() and add get/set_l2_bitmap()
commit39a9f0a50ea0e85f1be4db1c17ecd25387c3851b
authorAlberto Garcia <berto@igalia.com>
Fri, 10 Jul 2020 16:12:55 +0000 (10 18:12 +0200)
committerMax Reitz <mreitz@redhat.com>
Tue, 25 Aug 2020 06:33:20 +0000 (25 08:33 +0200)
tree40ea4e4278ca7a3056d716b46823ca823d90c19f
parentc8fd8554d972904bd0b04673298fea1af7a37780
qcow2: Update get/set_l2_entry() and add get/set_l2_bitmap()

Extended L2 entries are 128-bit wide: 64 bits for the entry itself and
64 bits for the subcluster allocation bitmap.

In order to support them correctly get/set_l2_entry() need to be
updated so they take the entry width into account in order to
calculate the correct offset.

This patch also adds the get/set_l2_bitmap() functions that are
used to access the bitmaps. For convenience we allow calling
get_l2_bitmap() on images without subclusters. In this case the
returned value is always 0 and has no meaning.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <6ee0f81ae3329c991de125618b3675e1e46acdbb.1594396418.git.berto@igalia.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/qcow2.h