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

Function ddt_repair_start

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

Source from the content-addressed store, hash-verified

898}
899
900ddt_entry_t *
901ddt_repair_start(ddt_t *ddt, const blkptr_t *bp)
902{
903 ddt_key_t ddk;
904 ddt_entry_t *dde;
905
906 ddt_key_fill(&ddk, bp);
907
908 dde = ddt_alloc(&ddk);
909
910 for (enum ddt_type type = 0; type < DDT_TYPES; type++) {
911 for (enum ddt_class class = 0; class < DDT_CLASSES; class++) {
912 /*
913 * We can only do repair if there are multiple copies
914 * of the block. For anything in the UNIQUE class,
915 * there's definitely only one copy, so don't even try.
916 */
917 if (class != DDT_CLASS_UNIQUE &&
918 ddt_object_lookup(ddt, type, class, dde) == 0)
919 return (dde);
920 }
921 }
922
923 bzero(dde->dde_phys, sizeof (dde->dde_phys));
924
925 return (dde);
926}
927
928void
929ddt_repair_done(ddt_t *ddt, ddt_entry_t *dde)

Callers 2

ddt_repair_tableFunction · 0.85
zio_ddt_read_startFunction · 0.85

Calls 4

ddt_key_fillFunction · 0.85
ddt_allocFunction · 0.85
ddt_object_lookupFunction · 0.85
bzeroFunction · 0.85

Tested by

no test coverage detected