mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
abd: lift ABD zero scan from zio_compress_data() to abd_cmp_zero()
It's now the caller's responsibility do special handling for holes if that's something it wants. This also makes zio_compress_data() and zio_decompress_data() properly the inverse of each other. Sponsored-by: Klara, Inc. Sponsored-by: Wasabi Technology, Inc. Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Jason Lee <jasonlee@lanl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <rob.norris@klarasystems.com> Closes #16326
This commit is contained in:
@@ -137,6 +137,7 @@ void abd_copy_from_buf_off(abd_t *, const void *, size_t, size_t);
|
||||
void abd_copy_to_buf_off(void *, abd_t *, size_t, size_t);
|
||||
int abd_cmp(abd_t *, abd_t *);
|
||||
int abd_cmp_buf_off(abd_t *, const void *, size_t, size_t);
|
||||
int abd_cmp_zero_off(abd_t *, size_t, size_t);
|
||||
void abd_zero_off(abd_t *, size_t, size_t);
|
||||
void abd_verify(abd_t *);
|
||||
|
||||
@@ -183,6 +184,12 @@ abd_zero(abd_t *abd, size_t size)
|
||||
abd_zero_off(abd, 0, size);
|
||||
}
|
||||
|
||||
static inline int
|
||||
abd_cmp_zero(abd_t *abd, size_t size)
|
||||
{
|
||||
return (abd_cmp_zero_off(abd, 0, size));
|
||||
}
|
||||
|
||||
/*
|
||||
* ABD type check functions
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user