aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/ddt.h
diff options
context:
space:
mode:
authorRob Norris <[email protected]>2023-06-09 10:14:42 +1000
committerBrian Behlendorf <[email protected]>2024-02-15 11:45:00 -0800
commit0cb1ef60ae26d855e8f4a959fff66a7693766ea3 (patch)
treeb3b4a31c9db8461481a7116c195bc634a08b228f /include/sys/ddt.h
parent5c4cc21fd4e0d15afc3f94895f26efabe80908c6 (diff)
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 <[email protected]> Signed-off-by: Rob Norris <[email protected]> Sponsored-by: Klara, Inc. Sponsored-by: iXsystems, Inc. Closes #15887
Diffstat (limited to 'include/sys/ddt.h')
-rw-r--r--include/sys/ddt.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/sys/ddt.h b/include/sys/ddt.h
index 2f9ff84b2..e6bbaa10e 100644
--- a/include/sys/ddt.h
+++ b/include/sys/ddt.h
@@ -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);