mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37: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:
@@ -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);
|
||||
|
||||
@@ -68,7 +68,6 @@ abd_t *abd_get_offset_scatter(abd_t *, abd_t *, size_t, size_t);
|
||||
void abd_free_struct_impl(abd_t *);
|
||||
void abd_alloc_chunks(abd_t *, size_t);
|
||||
void abd_free_chunks(abd_t *);
|
||||
boolean_t abd_size_alloc_linear(size_t);
|
||||
void abd_update_scatter_stats(abd_t *, abd_stats_op_t);
|
||||
void abd_update_linear_stats(abd_t *, abd_stats_op_t);
|
||||
void abd_verify_scatter(abd_t *);
|
||||
|
||||
Reference in New Issue
Block a user