Denis V. Lunev 443668ca40 block: split write_zeroes always
We should split requests even if they are less than write_zeroes_alignment.
For example we can have the following request:
  offset 62k
  size   4k
  write_zeroes_alignment 64k
The original code sent 1 request covering 2 qcow2 clusters, and resulted
in both clusters being allocated. But by splitting the request, we can
cater to the case where one of the two clusters can be zeroed as a
whole, for only 1 cluster allocated after the operation.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Eric Blake <eblake@redhat.com>
CC: Kevin Wolf <kwolf@redhat.com>
Message-Id: <1463476543-3087-2-git-send-email-den@openvz.org>

[eblake: Avoid exceeding nb_sectors, hoist alignment checks out of
loop, and update testsuite to show that patch works]

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2016-06-08 10:21:08 +02:00
..
2016-05-25 19:04:21 +02:00
2016-05-25 19:04:21 +02:00
2016-05-12 16:33:40 +01:00
2016-06-07 18:19:24 +03:00
2016-06-08 10:21:08 +02:00
2016-05-12 15:22:07 +02:00
2016-05-25 19:04:21 +02:00
2016-05-12 15:22:09 +02:00
2016-05-12 15:22:09 +02:00
2016-05-12 15:22:09 +02:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-05-19 16:54:12 +01:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-05-12 15:22:07 +02:00
2016-05-25 19:04:10 +02:00
2016-05-25 19:04:21 +02:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00
2016-06-07 18:19:24 +03:00