qemu-e2k/block
Kevin Wolf eb8a0cf3ba qcow2: Forward ZERO_WRITE flag for full preallocation
The BDRV_REQ_ZERO_WRITE is currently implemented in a way that first the
image is possibly preallocated and then the zero flag is added to all
clusters. This means that a copy-on-write operation may be needed when
writing to these clusters, despite having used preallocation, negating
one of the major benefits of preallocation.

Instead, try to forward the BDRV_REQ_ZERO_WRITE to the protocol driver,
and if the protocol driver can ensure that the new area reads as zeros,
we can skip setting the zero flag in the qcow2 layer.

Unfortunately, the same approach doesn't work for metadata
preallocation, so we'll still set the zero flag there.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Message-Id: <20200424142701.67053-1-kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2020-04-30 17:51:07 +02:00
..
monitor Use &error_abort instead of separate assert() 2020-03-17 16:05:40 +01:00
accounting.c
aio_task.c
backup-top.c block/block-copy: hide structure definitions 2020-03-11 12:42:30 +01:00
backup-top.h
backup.c backup: don't acquire aio_context in backup_clean 2020-04-07 14:34:47 +02:00
blkdebug.c
blklogwrites.c
blkreplay.c
blkverify.c block: Remove bdrv_recurse_is_first_non_filter() 2020-02-18 11:55:40 +01:00
block-backend.c block-backend: Add flags to blk_truncate() 2020-04-30 17:51:07 +02:00
block-copy.c block/block-copy: hide structure definitions 2020-03-11 12:42:30 +01:00
bochs.c
cloop.c
commit.c block-backend: Add flags to blk_truncate() 2020-04-30 17:51:07 +02:00
copy-on-read.c block: Remove bdrv_recurse_is_first_non_filter() 2020-02-18 11:55:40 +01:00
create.c
crypto.c block-backend: Add flags to blk_truncate() 2020-04-30 17:51:07 +02:00
crypto.h
curl.c block/curl: HTTP header field names are case insensitive 2020-03-11 12:42:29 +01:00
dirty-bitmap.c block/dirty-bitmap: improve _next_dirty_area API 2020-03-18 14:03:46 -04:00
dmg-bz2.c
dmg-lzfse.c
dmg.c
dmg.h
file-posix.c file-posix: Support BDRV_REQ_ZERO_WRITE for truncate 2020-04-30 17:51:07 +02:00
file-win32.c block: Add flags to BlockDriver.bdrv_co_truncate() 2020-04-30 17:51:07 +02:00
filter-compress.c block: Remove bdrv_recurse_is_first_non_filter() 2020-02-18 11:55:40 +01:00
gluster.c block: Add flags to BlockDriver.bdrv_co_truncate() 2020-04-30 17:51:07 +02:00
io_uring.c block/io_uring: Remove superfluous semicolon 2020-02-18 10:54:02 +01:00
io.c block: truncate: Don't make backing file data visible 2020-04-30 17:51:07 +02:00
iscsi-opts.c
iscsi.c block: Add flags to BlockDriver.bdrv_co_truncate() 2020-04-30 17:51:07 +02:00
linux-aio.c misc: Replace zero-length arrays with flexible array member (automatic) 2020-03-16 22:07:42 +01:00
Makefile.objs monitor/hmp: rename device-hotplug.c to block/monitor/block-hmp-cmds.c 2020-03-09 18:05:31 +00:00
mirror.c block-backend: Add flags to blk_truncate() 2020-04-30 17:51:07 +02:00
nbd.c block: trickle down the fallback image creation function use to the block drivers 2020-03-26 14:44:33 +01:00
nfs.c block: Add flags to BlockDriver.bdrv_co_truncate() 2020-04-30 17:51:07 +02:00
null.c
nvme.c block: trickle down the fallback image creation function use to the block drivers 2020-03-26 14:44:33 +01:00
parallels.c block: Add flags to bdrv(_co)_truncate() 2020-04-30 17:51:07 +02:00
parallels.h
qapi-sysemu.c block: Move system emulator QMP commands to block/qapi-sysemu.c 2020-03-06 17:15:38 +01:00
qapi.c block: Fix VM size field width in snapshot dump 2020-02-20 16:43:42 +01:00
qcow2-bitmap.c block/qcow2-bitmap: use bdrv_dirty_bitmap_next_dirty 2020-03-18 14:03:46 -04:00
qcow2-cache.c
qcow2-cluster.c qcow2: Support BDRV_REQ_ZERO_WRITE for truncate 2020-04-30 17:51:07 +02:00
qcow2-refcount.c block: Add flags to bdrv(_co)_truncate() 2020-04-30 17:51:07 +02:00
qcow2-snapshot.c
qcow2-threads.c block/qcow2-threads: fix qcow2_decompress 2020-03-11 12:42:30 +01:00
qcow2.c qcow2: Forward ZERO_WRITE flag for full preallocation 2020-04-30 17:51:07 +02:00
qcow2.h qcow2: Remove unused fields from BDRVQcow2State 2020-03-27 14:47:23 +01:00
qcow.c block: Add flags to bdrv(_co)_truncate() 2020-04-30 17:51:07 +02:00
qed-check.c
qed-cluster.c
qed-l2-cache.c
qed-table.c
qed.c block-backend: Add flags to blk_truncate() 2020-04-30 17:51:07 +02:00
qed.h
quorum.c quorum: Stop marking it as a filter 2020-02-18 11:55:40 +01:00
raw-format.c raw-format: Support BDRV_REQ_ZERO_WRITE for truncate 2020-04-30 17:51:07 +02:00
rbd.c block: Add flags to BlockDriver.bdrv_co_truncate() 2020-04-30 17:51:07 +02:00
replication.c various: Remove suspicious '\' character outside of #define in C code 2020-04-29 08:01:51 +02:00
sheepdog.c block: Add flags to BlockDriver.bdrv_co_truncate() 2020-04-30 17:51:07 +02:00
snapshot.c
ssh.c block: Add flags to BlockDriver.bdrv_co_truncate() 2020-04-30 17:51:07 +02:00
stream.c block/stream: Remove redundant statement in stream_run() 2020-03-09 15:59:31 +01:00
throttle-groups.c
throttle.c block: Remove bdrv_recurse_is_first_non_filter() 2020-02-18 11:55:40 +01:00
trace-events block/block-copy: use block_status 2020-03-11 12:42:30 +01:00
vdi.c block-backend: Add flags to blk_truncate() 2020-04-30 17:51:07 +02:00
vhdx-endian.c
vhdx-log.c block: Add flags to bdrv(_co)_truncate() 2020-04-30 17:51:07 +02:00
vhdx.c block-backend: Add flags to blk_truncate() 2020-04-30 17:51:07 +02:00
vhdx.h
vmdk.c block-backend: Add flags to blk_truncate() 2020-04-30 17:51:07 +02:00
vpc.c block-backend: Add flags to blk_truncate() 2020-04-30 17:51:07 +02:00
vvfat.c block/vvfat: Do not unref qcow on closing backing bdrv 2020-02-18 10:53:56 +01:00
vxhs.c
win32-aio.c
write-threshold.c