aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/ddt_zap.c
diff options
context:
space:
mode:
authorRob Norris <[email protected]>2024-06-30 12:10:00 +1000
committerTony Hutter <[email protected]>2024-08-22 16:22:24 -0700
commitd3c12383c95cf7988ac00234a42a4da7989c9034 (patch)
tree5150793d5877686d9bc71b6b95e41934feab5fce /module/zfs/ddt_zap.c
parent522816498c0ea0d8dfa449cd18e2032b8ac0a9b8 (diff)
compress: change compression providers API to use ABDs
This commit changes the provider compress and decompress API to take ABD pointers instead of buffer pointers for both data source and destination. It then updates all providers to match. This doesn't actually change the providers to do chunked compression, just changes the API to allow such an update in the future. Helper macros are added to easily adapt the ABD functions to their buffer-based implementations. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Signed-off-by: Rob Norris <[email protected]>
Diffstat (limited to 'module/zfs/ddt_zap.c')
-rw-r--r--module/zfs/ddt_zap.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/module/zfs/ddt_zap.c b/module/zfs/ddt_zap.c
index 8e78ec327..e96984b86 100644
--- a/module/zfs/ddt_zap.c
+++ b/module/zfs/ddt_zap.c
@@ -53,8 +53,12 @@ ddt_zap_compress(const void *src, uchar_t *dst, size_t s_len, size_t d_len)
ASSERT3U(d_len, >=, s_len + 1); /* no compression plus version byte */
/* Call compress function directly to avoid hole detection. */
- c_len = ci->ci_compress((void *)src, dst, s_len, d_len - 1,
- ci->ci_level);
+ abd_t sabd, dabd;
+ abd_get_from_buf_struct(&sabd, (void *)src, s_len);
+ abd_get_from_buf_struct(&dabd, dst, d_len);
+ c_len = ci->ci_compress(&sabd, &dabd, s_len, d_len - 1, ci->ci_level);
+ abd_free(&dabd);
+ abd_free(&sabd);
if (c_len == s_len) {
cpfunc = ZIO_COMPRESS_OFF;