mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 10:54:35 +03:00
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
This commit is contained in:
+1
-1
@@ -181,7 +181,7 @@ abd_free_struct(abd_t *abd)
|
||||
abd_t *
|
||||
abd_alloc(size_t size, boolean_t is_metadata)
|
||||
{
|
||||
if (!zfs_abd_scatter_enabled || abd_size_alloc_linear(size))
|
||||
if (abd_size_alloc_linear(size))
|
||||
return (abd_alloc_linear(size, is_metadata));
|
||||
|
||||
VERIFY3U(size, <=, SPA_MAXBLOCKSIZE);
|
||||
|
||||
Reference in New Issue
Block a user