| 145 | } |
| 146 | |
| 147 | static void |
| 148 | ddt_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 | |
| 173 | static int |
| 174 | ddt_object_lookup(ddt_t *ddt, enum ddt_type type, enum ddt_class class, |
no test coverage detected