mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
ddt: compare keys, not entries
We're about to have different kinds of things that we'll compare on key, so generalise this function to support that. (It actually worked fine because of the way the casts work out, but it requires the key to be at the start of the object so the cast through ddt_entry_t works, and even then it reads strangely for anything that's not a ddt_entry_t). Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Rob Norris <rob.norris@klarasystems.com> Sponsored-by: Klara, Inc. Sponsored-by: iXsystems, Inc. Closes #15887
This commit is contained in:
committed by
Brian Behlendorf
parent
5c4cc21fd4
commit
0cb1ef60ae
+2
-1
@@ -114,6 +114,7 @@ enum ddt_phys_type {
|
||||
* In-core ddt entry
|
||||
*/
|
||||
struct ddt_entry {
|
||||
/* key must be first for ddt_key_compare */
|
||||
ddt_key_t dde_key;
|
||||
ddt_phys_t dde_phys[DDT_PHYS_TYPES];
|
||||
zio_t *dde_lead_zio[DDT_PHYS_TYPES];
|
||||
@@ -230,7 +231,7 @@ extern boolean_t ddt_class_contains(spa_t *spa, enum ddt_class max_class,
|
||||
extern ddt_entry_t *ddt_repair_start(ddt_t *ddt, const blkptr_t *bp);
|
||||
extern void ddt_repair_done(ddt_t *ddt, ddt_entry_t *dde);
|
||||
|
||||
extern int ddt_entry_compare(const void *x1, const void *x2);
|
||||
extern int ddt_key_compare(const void *x1, const void *x2);
|
||||
|
||||
extern void ddt_create(spa_t *spa);
|
||||
extern int ddt_load(spa_t *spa);
|
||||
|
||||
Reference in New Issue
Block a user