]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Avoid small buffer copying on write
authorAlexander Motin <mav@FreeBSD.org>
Tue, 27 Jul 2021 23:05:47 +0000 (19:05 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 26 Jul 2022 17:10:37 +0000 (10:10 -0700)
commit415882d2287419f02d91dfba8059825c62eadb66
treee73e0f845d1f091087788405018e663f0e8d798a
parent5b860ae1fb37f6994e108f14058bba7152ceb4a1
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