Lines Matching refs:ddt
56 #include <sys/ddt.h>
132 ddt_hash_append(libzfs_handle_t *hdl, dedup_table_t *ddt, dedup_entry_t **ddepp,
137 if (ddt->cur_ddt_size >= ddt->max_ddt_size) {
138 if (ddt->ddt_full == B_FALSE) {
142 ddt->ddt_full = B_TRUE;
147 if ((dde = umem_cache_alloc(ddt->ddecache, UMEM_DEFAULT))
155 ddt->cur_ddt_size += sizeof (dedup_entry_t);
156 ddt->ddt_count++;
170 ddt_update(libzfs_handle_t *hdl, dedup_table_t *ddt, zio_cksum_t *cs,
176 hashcode = BF64_GET(cs->zc_word[0], 0, ddt->numhashbits);
178 for (ddepp = &(ddt->dedup_hash_array[hashcode]); *ddepp != NULL;
186 ddt_hash_append(hdl, ddt, ddepp, cs, prop, dr);
231 dedup_table_t ddt;
236 ddt.max_ddt_size =
240 numbuckets = ddt.max_ddt_size/(sizeof (dedup_entry_t));
249 ddt.dedup_hash_array = calloc(numbuckets, sizeof (dedup_entry_t *));
250 ddt.ddecache = umem_cache_create("dde", sizeof (dedup_entry_t), 0,
252 ddt.cur_ddt_size = numbuckets * sizeof (dedup_entry_t *);
253 ddt.numhashbits = high_order_bit(numbuckets) - 1;
254 ddt.ddt_full = B_FALSE;
382 if (ddt_update(dda->dedup_hdl, &ddt,
453 umem_cache_destroy(ddt.ddecache);
454 free(ddt.dedup_hash_array);