aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/abd.h
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 /include/sys/abd.h
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 'include/sys/abd.h')
-rw-r--r--include/sys/abd.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/sys/abd.h b/include/sys/abd.h
index 6903e0c0e..5c6bd0c27 100644
--- a/include/sys/abd.h
+++ b/include/sys/abd.h
@@ -91,6 +91,7 @@ abd_t *abd_alloc_linear(size_t, boolean_t);
abd_t *abd_alloc_gang(void);
abd_t *abd_alloc_for_io(size_t, boolean_t);
abd_t *abd_alloc_sametype(abd_t *, size_t);
+boolean_t abd_size_alloc_linear(size_t);
void abd_gang_add(abd_t *, abd_t *, boolean_t);
void abd_free(abd_t *);
abd_t *abd_get_offset(abd_t *, size_t);