mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
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 <rob.norris@klarasystems.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user