aboutsummaryrefslogtreecommitdiffstats
path: root/module/os/freebsd/zfs/abd_os.c
diff options
context:
space:
mode:
authorAlexander Motin <[email protected]>2021-07-27 19:05:47 -0400
committerGitHub <[email protected]>2021-07-27 16:05:47 -0700
commit7eebcd2be6ac91a1c28ed6a2184efb81aa9aa2a4 (patch)
tree841a24b362c0da167803ac6205242c8b9292b752 /module/os/freebsd/zfs/abd_os.c
parentb72611f0f612bf9ffeda827ea0bdf4cc36d9c6e4 (diff)
Avoid small buffer copying on write
It is wrong for arc_write_ready() to use zfs_abd_scatter_enabled to decide whether to reallocate/copy the buffer, because the answer is OS-specific and depends on the buffer size. Instead of that use abd_size_alloc_linear(), moved into public header. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Brian Atkinson <[email protected]> Signed-off-by: Alexander Motin <[email protected]> Closes #12425
Diffstat (limited to 'module/os/freebsd/zfs/abd_os.c')
-rw-r--r--module/os/freebsd/zfs/abd_os.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/os/freebsd/zfs/abd_os.c b/module/os/freebsd/zfs/abd_os.c
index 95a83542f..8bc1ef132 100644
--- a/module/os/freebsd/zfs/abd_os.c
+++ b/module/os/freebsd/zfs/abd_os.c
@@ -132,7 +132,7 @@ abd_scatter_chunkcnt(abd_t *abd)
boolean_t
abd_size_alloc_linear(size_t size)
{
- return (size < zfs_abd_scatter_min_size ? B_TRUE : B_FALSE);
+ return (!zfs_abd_scatter_enabled || size < zfs_abd_scatter_min_size);
}
void