Re: [libvirt] [PATCH option 1] Use fallocate directly if possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> If fallocate() is present, use it directly instead of posix_allocate().
> If it is not support by the kernel or filesystem, emulate it using
> mmap() or write().
> 
> This change is to work around slow fallocate emulation done by glibc's
> posix_allocate() when used on files opened with O_DSYNC.

Hmm, there is a dark side of this patch. Since fallocate is not portable, we
use posix_fallocate in case fallocate is not available. Although this could
happen because another system call with similar semantics exists, it can also
happen on older linux distributions where there is no equivalent of fallocate
call. And in such distributions (RHEL5 being one example), this patch will
make no functional change. So either we could sacrifice portability by not
using posix_fallocate at all or come up with something else. Or use the patch
from option 2.

Jirka

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]