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

Function ddt_prefetch

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

Source from the content-addressed store, hash-verified

730}
731
732void
733ddt_prefetch(spa_t *spa, const blkptr_t *bp)
734{
735 ddt_t *ddt;
736 ddt_entry_t dde;
737
738 if (!zfs_dedup_prefetch || bp == NULL || !BP_GET_DEDUP(bp))
739 return;
740
741 /*
742 * We only remove the DDT once all tables are empty and only
743 * prefetch dedup blocks when there are entries in the DDT.
744 * Thus no locking is required as the DDT can't disappear on us.
745 */
746 ddt = ddt_select(spa, bp);
747 ddt_key_fill(&dde.dde_key, bp);
748
749 for (enum ddt_type type = 0; type < DDT_TYPES; type++) {
750 for (enum ddt_class class = 0; class < DDT_CLASSES; class++) {
751 ddt_object_prefetch(ddt, type, class, &dde);
752 }
753 }
754}
755
756/*
757 * Opaque struct used for ddt_key comparison

Callers 1

dbuf_dirtyFunction · 0.85

Calls 3

ddt_selectFunction · 0.85
ddt_key_fillFunction · 0.85
ddt_object_prefetchFunction · 0.85

Tested by

no test coverage detected