aboutsummaryrefslogtreecommitdiffstats
path: root/module/os/freebsd/zfs/zfs_znode.c
diff options
context:
space:
mode:
Diffstat (limited to 'module/os/freebsd/zfs/zfs_znode.c')
-rw-r--r--module/os/freebsd/zfs/zfs_znode.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/module/os/freebsd/zfs/zfs_znode.c b/module/os/freebsd/zfs/zfs_znode.c
index 6a59c0eae..9b48dcda1 100644
--- a/module/os/freebsd/zfs/zfs_znode.c
+++ b/module/os/freebsd/zfs/zfs_znode.c
@@ -1476,12 +1476,16 @@ zfs_free_range(znode_t *zp, uint64_t off, uint64_t len)
error = dmu_free_long_range(zfsvfs->z_os, zp->z_id, off, len);
if (error == 0) {
+#if __FreeBSD_version >= 1400032
+ vnode_pager_purge_range(ZTOV(zp), off, off + len);
+#else
/*
- * In FreeBSD we cannot free block in the middle of a file,
- * but only at the end of a file, so this code path should
- * never happen.
+ * Before __FreeBSD_version 1400032 we cannot free block in the
+ * middle of a file, but only at the end of a file, so this code
+ * path should never happen.
*/
vnode_pager_setsize(ZTOV(zp), off);
+#endif
}
zfs_rangelock_exit(lr);