qcow2: Fix discard
authorMax Reitz <mreitz@redhat.com>
Tue, 29 Apr 2014 14:12:30 +0000 (16:12 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 29 Apr 2014 14:39:51 +0000 (16:39 +0200)
commitc883db0df9dbf26471c1418a632b216b0c1104f1
treead4a9bc9045839734a5c170a4cfa07071f9ae52c
parentcc8a7e560ca7932bacabc8a7113ac73976917848
qcow2: Fix discard

discard_single_l2() should not implement its own version of
qcow2_get_cluster_type(), but rather rely on this already existing
function. By doing so, it will work for compressed clusters as well
(which it did not so far).

Also, rename "old_offset" to "old_l2_entry", as both are quite different
(and the value is indeed of the latter kind).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2-cluster.c