]> git.proxmox.com Git - qemu.git/commit
qcow2: Batch discards
authorKevin Wolf <kwolf@redhat.com>
Wed, 19 Jun 2013 11:44:20 +0000 (13:44 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 24 Jun 2013 08:25:17 +0000 (10:25 +0200)
commit0b919fae31f4f80f78ebeab8388dc3a03cc5e4ed
treed28c579aa6c160de1efe1d46cf91c1c80f794e3f
parent67af674e478054086f972811dd0a11289afa39a9
qcow2: Batch discards

This optimises the discard operation for freed clusters by batching
discard requests (both snapshot deletion and bdrv_discard end up
updating the refcounts cluster by cluster).

Note that we don't discard asynchronously, but keep s->lock held. This
is to avoid that a freed cluster is reallocated and written to while the
discard is still in flight.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/qcow2-cluster.c
block/qcow2-refcount.c
block/qcow2.c
block/qcow2.h