On 7/19/23 3:38 PM, Eric Sandeen wrote:
On 7/19/23 3:29 PM, Andres Freund wrote:
Somewhat tangential: I still would like a fallocate() option that
actually
zeroes out new extents (via "write zeroes", if supported), rather than
just
setting them up as unwritten extents. Nor for "data" files, but for
WAL/journal files.
Like this?
fallocate(2):
Zeroing file space
Specifying the FALLOC_FL_ZERO_RANGE flag (available since
Linux 3.15) in mode zeros space in the byte range starting at offset and
continuing for len bytes.
Under the covers, that uses efficient zeroing methods when available.
-Eric
Hm sorry, it's been a while. Maybe I'm wrong about this; I know it does
efficient zeroing when pointed at a block device but I guess I've
confused myself about what happens on a filesystem like XFS that
supports unwritten extents.
-Eric