qcow2: Add get_l2_entry() and set_l2_entry()
commit12c6aebedfb6b90d5f019ab536dd3f2752e6e361
authorAlberto Garcia <berto@igalia.com>
Fri, 10 Jul 2020 16:12:48 +0000 (10 18:12 +0200)
committerMax Reitz <mreitz@redhat.com>
Tue, 25 Aug 2020 06:33:20 +0000 (25 08:33 +0200)
tree496536e3698896e7bd84fd5e8c01d47997484a32
parent57538c864f3ad67d515892fd54b11ff59981b84d
qcow2: Add get_l2_entry() and set_l2_entry()

The size of an L2 entry is 64 bits, but if we want to have subclusters
we need extended L2 entries. This means that we have to access L2
tables and slices differently depending on whether an image has
extended L2 entries or not.

This patch replaces all l2_slice[] accesses with calls to
get_l2_entry() and set_l2_entry().

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <9586363531fec125ba1386e561762d3e4224e9fc.1594396418.git.berto@igalia.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/qcow2-cluster.c
block/qcow2-refcount.c
block/qcow2.h