Add helper to parse compressed l2_entry and use it everywhere instead
of open-coding.
Note, that in most places we move to precise coffset/csize instead of
sector-aligned. Still it should work good enough for updating
refcounts.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
block/qcow2.h | 3 ++-
block/qcow2-cluster.c | 15 +++++++++++++++
block/qcow2-refcount.c | 36 +++++++++++++++++-------------------
block/qcow2.c | 9 ++-------
4 files changed, 36 insertions(+), 27 deletions(-)