HomeFreeBSD

zfs_file: implement zfs_file_deallocate for FreeBSD 14

Description

zfs_file: implement zfs_file_deallocate for FreeBSD 14

FreeBSD 14 gained a VOP_DEALLOCATE VFS operation and a fspacectl
syscall to use it. At minimum, these zero the given region, and if the
underlying filesystem supports it, can make the region sparse. We can
use this to get TRIM-like behaviour for file vdevs.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #16496

Details

Provenance
rob.norris_klarasystems.comAuthored on Sep 1 2024, 2:34 AM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Sep 18 2024, 6:35 PM
Parents
rGfa330646b987: zfs_file: rename zfs_file_fallocate to zfs_file_deallocate
Branches
Unknown
Tags
Unknown