HomeFreeBSD

vfs_vnops.c: Fix blksize for ZFS

Description

vfs_vnops.c: Fix blksize for ZFS

Since ZFS reports _PC_MIN_HOLE_SIZE as 512 (although it
appears that an unwritten region must be at least f_iosize
to remain unallocated), vn_generic_copy_file_range()
uses 4096 for the copy blksize for ZFS, reulting in slow copies.

For most other file systems, _PC_MIN_HOLE_SIZE and f_iosize
are the same value, so this patch modifies the code to
use f_iosize for most cases. It also documents in comments
why the blksize is being set a certain way, so that the code
does not appear to be doing "magic math".

(cherry picked from commit 4ee16246f97825e893e0a4a4499d1bbe5bc07b6a)

Details

Provenance
rmacklemAuthored on Nov 17 2022, 1:37 AM
Parents
rGabc542e34736: MFV: expat 2.5.0
Branches
Unknown
Tags
Unknown