qcow2: Add l2_slice_size field to BDRVQcow2State
commit3c2e511a24b51c5bfc70d365b54ad8c612d3b07c
authorAlberto Garcia <berto@igalia.com>
Mon, 5 Feb 2018 14:33:13 +0000 (5 16:33 +0200)
committerMax Reitz <mreitz@redhat.com>
Tue, 13 Feb 2018 15:59:59 +0000 (13 16:59 +0100)
treeacaa8bfc760dd6b9904c151f25ffb65bc07edabc
parent05b5b6ee54cf69e7053c73286aac354be754235e
qcow2: Add l2_slice_size field to BDRVQcow2State

The BDRVQcow2State structure contains an l2_size field, which stores
the number of 64-bit entries in an L2 table.

For efficiency reasons we want to be able to load slices instead of
full L2 tables, so we need to know how many entries an L2 slice can
hold.

An L2 slice is the portion of an L2 table that is loaded by the qcow2
cache. At the moment that cache can only load complete tables,
therefore an L2 slice has the same size as an L2 table (one cluster)
and l2_size == l2_slice_size.

Later we'll allow smaller slices, but until then we have to use this
new l2_slice_size field to make the rest of the code ready for that.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-id: adb048595f9fb5dfb110c802a8b3c3be3b937f37.1517840877.git.berto@igalia.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/qcow2.c
block/qcow2.h