Avoid small buffer copying on write
commit7eebcd2be6ac91a1c28ed6a2184efb81aa9aa2a4
authorAlexander Motin <mav@FreeBSD.org>
Tue, 27 Jul 2021 23:05:47 +0000 (27 19:05 -0400)
committerGitHub <noreply@github.com>
Tue, 27 Jul 2021 23:05:47 +0000 (27 16:05 -0700)
tree841a24b362c0da167803ac6205242c8b9292b752
parentb72611f0f612bf9ffeda827ea0bdf4cc36d9c6e4
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 <behlendorf1@llnl.gov>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Alexander Motin <mav@FreeBSD.org>
Closes #12425
include/sys/abd.h
include/sys/abd_impl.h
module/os/freebsd/zfs/abd_os.c
module/os/linux/zfs/abd_os.c
module/zfs/abd.c
module/zfs/arc.c