aboutsummaryrefslogtreecommitdiffstats
path: root/module/os/freebsd/zfs/zfs_vnops_os.c
diff options
context:
space:
mode:
authorRich Ercolani <[email protected]>2023-11-16 14:35:22 -0500
committerGitHub <[email protected]>2023-11-16 11:35:22 -0800
commit03e9caaec006134b3db9d02ac40fe9369ee78b03 (patch)
treef6a1da33e5a886c5ce3b80189efdbd806e33c337 /module/os/freebsd/zfs/zfs_vnops_os.c
parent5796e3a74265f1d808b232dcaf65ba440de019c0 (diff)
Add a tunable to disable BRT support.
Copy the disable parameter that FreeBSD implemented, and extend it to work on Linux as well, until we're sure this is stable. Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rich Ercolani <[email protected]> Closes #15529
Diffstat (limited to 'module/os/freebsd/zfs/zfs_vnops_os.c')
-rw-r--r--module/os/freebsd/zfs/zfs_vnops_os.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/module/os/freebsd/zfs/zfs_vnops_os.c b/module/os/freebsd/zfs/zfs_vnops_os.c
index c37f543ce..107cd69c7 100644
--- a/module/os/freebsd/zfs/zfs_vnops_os.c
+++ b/module/os/freebsd/zfs/zfs_vnops_os.c
@@ -6250,6 +6250,11 @@ zfs_freebsd_copy_file_range(struct vop_copy_file_range_args *ap)
int error;
uint64_t len = *ap->a_lenp;
+ if (!zfs_bclone_enabled) {
+ mp = NULL;
+ goto bad_write_fallback;
+ }
+
/*
* TODO: If offset/length is not aligned to recordsize, use
* vn_generic_copy_file_range() on this fragment.