qcow2: Allow reading both COW regions with only one request
commitb3cf1c7cf8714af96def49668a267fa4075242ca
authorAlberto Garcia <berto@igalia.com>
Mon, 19 Jun 2017 13:40:06 +0000 (19 16:40 +0300)
committerKevin Wolf <kwolf@redhat.com>
Mon, 26 Jun 2017 12:51:13 +0000 (26 14:51 +0200)
tree786ca93bbde6ffe9802f723c68faf69faae93828
parent672f0f2c4b5ee521f5ea06eadaacf8dfa99474f4
qcow2: Allow reading both COW regions with only one request

Reading both COW regions requires two separate requests, but it's
perfectly possible to merge them and perform only one. This generally
improves performance, particularly on rotating disk drives. The
downside is that the data in the middle region is read but discarded.

This patch takes a conservative approach and only merges reads when
the size of the middle region is <= 16KB.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2-cluster.c