XFS supports "holes". But we created file 100mb with 0 only in it, and it's actual size
was 100mb, for zeros this support doesn't work. We created other file wrote some bytes at the
beggining then did seek ~1GB and wrote to the end couple more bytes. XFS was showing it's size of
1GB, but actual size of it on the disc was only few bytes, that's called "HOLE" as I
understand. But it doesn't work for 0s, if you write a big ammount of zeros. What we have to do, to
write an add-on that would work for zeros, but problemm is we can't find any good enough
specification. We could dig over whole source that was being written several years, and VERY badly
documentated, but we are limited in time... If anybody could help with specification or give an
advice, we would really apretiate it!
"There is no requirement to detect blocks of zeroes being written in
order to replace them with holes (nor is it forbidden)."
2.2.1 File System Requirements
22.214.171.124 File system functionality
Efficient support for sparse files. Arbitrary holes must be supported,
areas of the file which have never been written and which read back as
zeroes. The representation must be disk-space efficient as well as
cpu-time efficient in retrieval of old data and insertion of new data.
There is no requirement to detect blocks of zeroes being written in
order to replace them with holes (nor is it forbidden). This capability
is important for some scientific and compute-intensive applications, as
well as for Hierarchical Storage Management (HSM).