MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ddt_object_sync

Function ddt_object_sync

freebsd/contrib/openzfs/module/zfs/ddt.c:147–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147static void
148ddt_object_sync(ddt_t *ddt, enum ddt_type type, enum ddt_class class,
149 dmu_tx_t *tx)
150{
151 ddt_object_t *ddo = &ddt->ddt_object_stats[type][class];
152 dmu_object_info_t doi;
153 uint64_t count;
154 char name[DDT_NAMELEN];
155
156 ddt_object_name(ddt, type, class, name);
157
158 VERIFY(zap_update(ddt->ddt_os, ddt->ddt_spa->spa_ddt_stat_object, name,
159 sizeof (uint64_t), sizeof (ddt_histogram_t) / sizeof (uint64_t),
160 &ddt->ddt_histogram[type][class], tx) == 0);
161
162 /*
163 * Cache DDT statistics; this is the only time they'll change.
164 */
165 VERIFY(ddt_object_info(ddt, type, class, &doi) == 0);
166 VERIFY(ddt_object_count(ddt, type, class, &count) == 0);
167
168 ddo->ddo_count = count;
169 ddo->ddo_dspace = doi.doi_physical_blocks_512 << 9;
170 ddo->ddo_mspace = doi.doi_fill_count * doi.doi_data_block_size;
171}
172
173static int
174ddt_object_lookup(ddt_t *ddt, enum ddt_type type, enum ddt_class class,

Callers 1

ddt_sync_tableFunction · 0.85

Calls 4

ddt_object_nameFunction · 0.85
zap_updateFunction · 0.85
ddt_object_infoFunction · 0.85
ddt_object_countFunction · 0.85

Tested by

no test coverage detected