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

Function zdb_ddt_leak_init

freebsd/contrib/openzfs/cmd/zdb/zdb.c:5508–5548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5506}
5507
5508static void
5509zdb_ddt_leak_init(spa_t *spa, zdb_cb_t *zcb)
5510{
5511 ddt_bookmark_t ddb;
5512 ddt_entry_t dde;
5513 int error;
5514 int p;
5515
5516 ASSERT(!dump_opt['L']);
5517
5518 bzero(&ddb, sizeof (ddb));
5519 while ((error = ddt_walk(spa, &ddb, &dde)) == 0) {
5520 blkptr_t blk;
5521 ddt_phys_t *ddp = dde.dde_phys;
5522
5523 if (ddb.ddb_class == DDT_CLASS_UNIQUE)
5524 return;
5525
5526 ASSERT(ddt_phys_total_refcnt(&dde) > 1);
5527
5528 for (p = 0; p < DDT_PHYS_TYPES; p++, ddp++) {
5529 if (ddp->ddp_phys_birth == 0)
5530 continue;
5531 ddt_bp_create(ddb.ddb_checksum,
5532 &dde.dde_key, ddp, &blk);
5533 if (p == DDT_PHYS_DITTO) {
5534 zdb_count_block(zcb, NULL, &blk, ZDB_OT_DITTO);
5535 } else {
5536 zcb->zcb_dedup_asize +=
5537 BP_GET_ASIZE(&blk) * (ddp->ddp_refcnt - 1);
5538 zcb->zcb_dedup_blocks++;
5539 }
5540 }
5541 ddt_t *ddt = spa->spa_ddt[ddb.ddb_checksum];
5542 ddt_enter(ddt);
5543 VERIFY(ddt_lookup(ddt, &blk, B_TRUE) != NULL);
5544 ddt_exit(ddt);
5545 }
5546
5547 ASSERT(error == ENOENT);
5548}
5549
5550typedef struct checkpoint_sm_exclude_entry_arg {
5551 vdev_t *cseea_vd;

Callers 1

zdb_leak_initFunction · 0.85

Calls 8

bzeroFunction · 0.85
ddt_walkFunction · 0.85
ddt_phys_total_refcntFunction · 0.85
ddt_bp_createFunction · 0.85
zdb_count_blockFunction · 0.85
ddt_enterFunction · 0.85
ddt_lookupFunction · 0.85
ddt_exitFunction · 0.85

Tested by

no test coverage detected