]> git.proxmox.com Git - mirror_zfs-debian.git/commit - module/zfs/zpl_inode.c
Implement the truncate_range() inode operation.
authorEtienne Dechamps <etienne.dechamps@ovh.net>
Thu, 1 Sep 2011 11:59:41 +0000 (13:59 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 9 Feb 2012 23:20:32 +0000 (15:20 -0800)
commit5cb63a57f8d2d1a94e65b4710bfbb221b1a71700
tree29217086ca4df5c495526cffa0b661563a5c1577
parent93648f314c258897a0fa72b0d0b164e1937a5b63
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
module/zfs/zpl_inode.c