| 730 | } |
| 731 | |
| 732 | void |
| 733 | ddt_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 |
no test coverage detected