FreeBSD: Reduce copy_file_range() source lock to shared
commitd0a91b9f88a47316158508bf304a61baa8c99c10
authorAlexander Motin <mav@FreeBSD.org>
Sat, 23 Nov 2024 22:29:03 +0000 (23 17:29 -0500)
committerGitHub <noreply@github.com>
Sat, 23 Nov 2024 22:29:03 +0000 (23 14:29 -0800)
treee3cc6fa0f4c84b05674a1425a34ae43b4e5ff9f9
parentb3b0ce64d50a948a3fab19d7cd4652b411ef200c
FreeBSD: Reduce copy_file_range() source lock to shared

Linux locks copy_file_range() source as shared.  FreeBSD was doing
it also, but then was changed to exclusive, partially because KPI
of that time was doing so, and partially seems out of caution.
Considering zfs_clone_range() uses range locks on both source and
destination, neither should require exclusive vnode locks. But one
step at a time, just sync it with Linux for now.

Reviewed-by: Alan Somers <asomers@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Sponsored by: iXsystems, Inc.
Closes #16789
Closes #16797
module/os/freebsd/zfs/zfs_vnops_os.c