DDT: Switch to using ZAP _by_dnode() interfaces

As was previously done for BRT, avoid holding/releasing DDT ZAP
dnodes for every access.  Instead hold the dnodes during all their
life time, never releasing.

While at this, add _by_dnode() interfaces for zap_length_uint64()
and zap_count(), actively used by DDT code.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Alexander Motin <alexander.motin@TrueNAS.com>
Closes #18047
This commit is contained in:
Alexander Motin
2025-12-15 12:49:14 -05:00
committed by GitHub
parent 46d6f1fe56
commit ff5414406f
6 changed files with 132 additions and 63 deletions
+3
View File
@@ -288,6 +288,8 @@ int zap_length(objset_t *ds, uint64_t zapobj, const char *name,
uint64_t *integer_size, uint64_t *num_integers);
int zap_length_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
int key_numints, uint64_t *integer_size, uint64_t *num_integers);
int zap_length_uint64_by_dnode(dnode_t *dn, const uint64_t *key,
int key_numints, uint64_t *integer_size, uint64_t *num_integers);
/*
* Remove the specified attribute.
@@ -309,6 +311,7 @@ int zap_remove_uint64_by_dnode(dnode_t *dn, const uint64_t *key,
* object.
*/
int zap_count(objset_t *ds, uint64_t zapobj, uint64_t *count);
int zap_count_by_dnode(dnode_t *dn, uint64_t *count);
/*
* Returns (in name) the name of the entry whose (value & mask)