I have attached a high level design document for implementing fallocate() support for Lustre.
The requirement for this as taken from the JIRA ticket (https://jira.hpdd.intel.com/browse/LU-3606) is as follows:
"The sys_fallocate() syscall was introduced to the linux kernel in the 2.6.24 kernel. There is also an ext4_fallocate() method added in this same kernel release. This has been available in vendor kernels since RHEL 5.4.
We need to implement an fallocate() method for llite, and transport this to the OSTs to interface with the underlying OSD's fallocate() code (for ldiskfs, ZFS has no such method).
The fallocate() API has been added to newer versions of the Lustre kernel to provide both persistent space reservation (block preallocation for a file, possibly beyond the file size, without having to write zeroes to the whole file), and for the reverse operation of hole punching (freeing allocated blocks in the middle or end of a file). However, Lustre predates these APIs and has not yet added support for them. Being able to preallocate space for a file is very useful for HPC applications that know the size of the output file in advance, and helps Lustre make better allocation decisions based on the file size."
I request you to kindly provide your feedback on the same.