HomeFreeBSD

Implement the truncate_range() inode operation.

Description

Implement the truncate_range() inode operation.

This operation allows "hole punching" in ZFS files. On Solaris this
is done via the vop_space() system call, which maps to the zfs_space()
function. So we just need to write zpl_truncate_range() as a wrapper
around zfs_space().

Note that this only works for regular files, not ZVOLs.

This is currently an insecure implementation without permission
checking, although this isn't that big of a deal since truncate_range()
isn't even callable from userspace.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #334

Details

Provenance
Etienne Dechamps <etienne.dechamps@ovh.net>Authored on Sep 1 2011, 11:59 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Feb 9 2012, 11:20 PM
Parents
rG93648f314c25: Fix zconfig.sh non-optimal alignment
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG5cb63a57f8d2: Implement the truncate_range() inode operation. (authored by Etienne Dechamps <etienne.dechamps@ovh.net>).Feb 9 2012, 11:20 PM