summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--sys_util/src/write_zeroes.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys_util/src/write_zeroes.rs b/sys_util/src/write_zeroes.rs
index 31ea652..15e9344 100644
--- a/sys_util/src/write_zeroes.rs
+++ b/sys_util/src/write_zeroes.rs
@@ -17,9 +17,9 @@ pub trait WriteZeroes {
 
 impl WriteZeroes for File {
     fn write_zeroes(&mut self, length: usize) -> io::Result<usize> {
-        // Try to use fallocate(FALLOC_FL_ZERO_RANGE) first.
+        // Try to use fallocate(FALLOC_FL_PUNCH_HOLE) first.
         let offset = self.seek(SeekFrom::Current(0))?;
-        match fallocate(self, FallocateMode::ZeroRange, false, offset, length as u64) {
+        match fallocate(self, FallocateMode::PunchHole, true, offset, length as u64) {
             Ok(()) => {
                 // Advance the seek cursor as if we had done a real write().
                 self.seek(SeekFrom::Current(length as i64))?;