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

Function ddt_load

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

Source from the content-addressed store, hash-verified

821}
822
823int
824ddt_load(spa_t *spa)
825{
826 int error;
827
828 ddt_create(spa);
829
830 error = zap_lookup(spa->spa_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
831 DMU_POOL_DDT_STATS, sizeof (uint64_t), 1,
832 &spa->spa_ddt_stat_object);
833
834 if (error)
835 return (error == ENOENT ? 0 : error);
836
837 for (enum zio_checksum c = 0; c < ZIO_CHECKSUM_FUNCTIONS; c++) {
838 ddt_t *ddt = spa->spa_ddt[c];
839 for (enum ddt_type type = 0; type < DDT_TYPES; type++) {
840 for (enum ddt_class class = 0; class < DDT_CLASSES;
841 class++) {
842 error = ddt_object_load(ddt, type, class);
843 if (error != 0 && error != ENOENT)
844 return (error);
845 }
846 }
847
848 /*
849 * Seed the cached histograms.
850 */
851 bcopy(ddt->ddt_histogram, &ddt->ddt_histogram_cache,
852 sizeof (ddt->ddt_histogram));
853 spa->spa_dedup_dspace = ~0ULL;
854 }
855
856 return (0);
857}
858
859void
860ddt_unload(spa_t *spa)

Callers 1

spa_ld_load_dedup_tablesFunction · 0.85

Calls 3

ddt_createFunction · 0.85
zap_lookupFunction · 0.85
ddt_object_loadFunction · 0.85

Tested by

no test coverage detected