mirror_zfs/include
Etienne Dechamps bbdc6ae495 Add interface for file hole punching.
This adds an interface to "punch holes" (deallocate space) in VFS
files. The interface is identical to the Solaris VOP_SPACE interface.
This interface is necessary for TRIM support on file vdevs.

This is implemented using Linux fallocate(FALLOC_FL_PUNCH_HOLE), which
was introduced in 2.6.38. For a brief time before 2.6.38 this was done
using the truncate_range inode operation, which was quickly deprecated.
This patch only supports FALLOC_FL_PUNCH_HOLE.

This adds support for the truncate_range() inode operation to
VOP_SPACE() for file hole punching. This API is deprecated and removed
in 3.5, so it's only useful for old kernels.

On tmpfs, the truncate_range() inode operation translates to
shmem_truncate_range(). Unfortunately, this function expects the end
offset to be inclusive and aligned to the end of a page. If it is not,
the kernel will stop with a BUG_ON().

This patch fixes the issue by adapting to the constraints set forth by
shmem_truncate_range().

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #168
2012-10-04 16:22:07 -07:00
..
fs Remove autotools products 2012-08-27 11:46:23 -07:00
linux Remove autotools products 2012-08-27 11:46:23 -07:00
rpc Remove autotools products 2012-08-27 11:46:23 -07:00
sharefs Remove autotools products 2012-08-27 11:46:23 -07:00
sys Add interface for file hole punching. 2012-10-04 16:22:07 -07:00
util Remove autotools products 2012-08-27 11:46:23 -07:00
vm Remove autotools products 2012-08-27 11:46:23 -07:00
Makefile.am Add the release component to headers 2012-01-18 11:06:26 -08:00
spl-ctl.h Public Release Prep 2010-05-17 15:18:00 -07:00
spl-debug.h Add missing spl_debug_* helpers 2012-02-09 16:41:46 -08:00
spl-device.h Public Release Prep 2010-05-17 15:18:00 -07:00
spl-trace.h Split <sys/debug.h> header 2010-07-20 13:29:35 -07:00
splat-ctl.h Add linux compatibility tests 2011-06-21 14:02:46 -07:00
strings.h Public Release Prep 2010-05-17 15:18:00 -07:00
unistd.h Public Release Prep 2010-05-17 15:18:00 -07:00