Changeset View
Changeset View
Standalone View
Standalone View
sys/contrib/openzfs/module/os/freebsd/zfs/zfs_znode.c
Show First 20 Lines • Show All 1,443 Lines • ▼ Show 20 Lines | if (off >= zp->z_size) { | ||||
return (0); | return (0); | ||||
} | } | ||||
if (off + len > zp->z_size) | if (off + len > zp->z_size) | ||||
len = zp->z_size - off; | len = zp->z_size - off; | ||||
error = dmu_free_long_range(zfsvfs->z_os, zp->z_id, off, len); | error = dmu_free_long_range(zfsvfs->z_os, zp->z_id, off, len); | ||||
if (error == 0) { | if (error == 0) | ||||
/* | vnode_pager_purge_range(ZTOV(zp), off, off + len); | ||||
* 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. | |||||
*/ | |||||
vnode_pager_setsize(ZTOV(zp), off); | |||||
} | |||||
zfs_rangelock_exit(lr); | zfs_rangelock_exit(lr); | ||||
return (error); | return (error); | ||||
} | } | ||||
/* | /* | ||||
* Truncate a file | * Truncate a file | ||||
▲ Show 20 Lines • Show All 600 Lines • Show Last 20 Lines |