aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/zfs_vnops.c
diff options
context:
space:
mode:
authorTim Chase <[email protected]>2014-08-20 17:35:13 -0500
committerBrian Behlendorf <[email protected]>2014-09-08 13:52:25 -0700
commit223df0161fad50f53a8fa5ffeea8cc4f8137d522 (patch)
tree4cb1ed2d880ab2c5c745e407267f2d6433213106 /module/zfs/zfs_vnops.c
parent4f68d7878fbed9e225022a1d435cfb7177234110 (diff)
Implement fallocate FALLOC_FL_PUNCH_HOLE
Add support for the FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE mode of fallocate(2). Mimic the behavior of other native file systems such as ext4 in cases where the file might be extended. If the offset is beyond the end of the file, return success without changing the file. If the extent of the punched hole would extend the file, only the existing tail of the file is punched. Add the zfs_zero_partial_page() function, modeled after update_page(), to handle zeroing partial pages in a hole-punching operation. It must be used under a range lock for the requested region in order that the ARC and page cache stay in sync. Move the existing page cache truncation via truncate_setsize() into zfs_freesp() for better source structure compatibility with upstream code. Add page cache truncation to zfs_freesp() and zfs_free_range() to handle hole punching. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Tim Chase <[email protected]> Closes #2619
Diffstat (limited to 'module/zfs/zfs_vnops.c')
-rw-r--r--module/zfs/zfs_vnops.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
index 18b2564a2..ddd997fae 100644
--- a/module/zfs/zfs_vnops.c
+++ b/module/zfs/zfs_vnops.c
@@ -2565,8 +2565,6 @@ top:
if (err)
goto out3;
- truncate_setsize(ip, vap->va_size);
-
/*
* XXX - Note, we are not providing any open
* mode flags here (like FNDELAY), so we may