summary refs log tree commit diff stats
path: root/hw/misc/macio/cuda.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2018-07-26 11:28:30 +0200
committerKevin Wolf <kwolf@redhat.com>2018-07-30 15:35:37 +0200
commit34fa110e424e9a6a9b7e0274c3d4bfee766eb7ed (patch)
tree9945980f1dc926e3eded753cd982e2778055fd38 /hw/misc/macio/cuda.c
parent52ebcb268273de217510bc9ed688c23894ae32a2 (diff)
downloadfocaccia-qemu-34fa110e424e9a6a9b7e0274c3d4bfee766eb7ed.tar.gz
focaccia-qemu-34fa110e424e9a6a9b7e0274c3d4bfee766eb7ed.zip
file-posix: Fix write_zeroes with unmap on block devices
The BLKDISCARD ioctl doesn't guarantee that the discarded blocks read as
all-zero afterwards, so don't try to abuse it for zero writing. We try
to only use this if BLKDISCARDZEROES tells us that it is safe, but this
is unreliable on older kernels and a constant 0 in newer kernels. In
other words, this code path is never actually used with newer kernels,
so we don't even try to unmap while writing zeros.

This patch removes the abuse of discard for writing zeroes from
file-posix and instead adds a new function that uses interfaces that are
actually meant to deallocate and zero out at the same time. Only if
those fail, it falls back to zeroing out without unmap. We never fall
back to a discard operation any more that may or may not result in
zeros.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/misc/macio/cuda.c')
0 files changed, 0 insertions, 0 deletions