Home
last modified time | relevance | path

Searched hist:"5 a1dad9d" (Results 1 – 1 of 1) sorted by relevance

/qemu/block/
H A Dfile-posix.c5a1dad9d Fri Feb 17 00:51:26 GMT 2017 Nir Soffer <nirsof@gmail.com> qemu-img: Truncate before full preallocation

In a previous commit (qemu-img: Do not truncate before preallocation) we
moved truncate to the PREALLOC_MODE_OFF branch to avoid slowdown in
posix_fallocate().

However this change is not optimal when using PREALLOC_MODE_FULL, since
knowing the final size from the beginning could allow the file system
driver to do less allocations and possibly avoid fragmentation of the
file.

Now we truncate also before doing full preallocation.

Signed-off-by: Nir Soffer <nirsof@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>