diff options
author | Rob Norris <[email protected]> | 2024-06-30 12:10:00 +1000 |
---|---|---|
committer | Tony Hutter <[email protected]> | 2024-08-22 16:22:24 -0700 |
commit | d3c12383c95cf7988ac00234a42a4da7989c9034 (patch) | |
tree | 5150793d5877686d9bc71b6b95e41934feab5fce /cmd/zstream | |
parent | 522816498c0ea0d8dfa449cd18e2032b8ac0a9b8 (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 'cmd/zstream')
-rw-r--r-- | cmd/zstream/zstream_decompress.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd/zstream/zstream_decompress.c b/cmd/zstream/zstream_decompress.c index f5f66080d..f8f439d46 100644 --- a/cmd/zstream/zstream_decompress.c +++ b/cmd/zstream/zstream_decompress.c @@ -288,10 +288,12 @@ zstream_do_decompress(int argc, char *argv[]) char *lzbuf = safe_calloc(payload_size); (void) sfread(lzbuf, payload_size, stdin); - abd_t sabd; + abd_t sabd, dabd; abd_get_from_buf_struct(&sabd, lzbuf, payload_size); - int err = zio_decompress_data(c, &sabd, buf, + abd_get_from_buf_struct(&dabd, buf, payload_size); + int err = zio_decompress_data(c, &sabd, &dabd, payload_size, payload_size, NULL); + abd_free(&dabd); abd_free(&sabd); if (err != 0) { |