Changeset View
Changeset View
Standalone View
Standalone View
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
Show First 20 Lines • Show All 548 Lines • ▼ Show 20 Lines | dnode_sync_free(dnode_t *dn, dmu_tx_t *tx) | ||||
/* ASSERT(blkptrs are zero); */ | /* ASSERT(blkptrs are zero); */ | ||||
ASSERT(dn->dn_phys->dn_type != DMU_OT_NONE); | ASSERT(dn->dn_phys->dn_type != DMU_OT_NONE); | ||||
ASSERT(dn->dn_type != DMU_OT_NONE); | ASSERT(dn->dn_type != DMU_OT_NONE); | ||||
ASSERT(dn->dn_free_txg > 0); | ASSERT(dn->dn_free_txg > 0); | ||||
if (dn->dn_allocated_txg != dn->dn_free_txg) | if (dn->dn_allocated_txg != dn->dn_free_txg) | ||||
dmu_buf_will_dirty(&dn->dn_dbuf->db, tx); | dmu_buf_will_dirty(&dn->dn_dbuf->db, tx); | ||||
bzero(dn->dn_phys, sizeof (dnode_phys_t) * dn->dn_num_slots); | bzero(dn->dn_phys, sizeof (dnode_phys_t) * dn->dn_num_slots); | ||||
dnode_free_interior_slots(dn); | |||||
mutex_enter(&dn->dn_mtx); | mutex_enter(&dn->dn_mtx); | ||||
dn->dn_type = DMU_OT_NONE; | dn->dn_type = DMU_OT_NONE; | ||||
dn->dn_maxblkid = 0; | dn->dn_maxblkid = 0; | ||||
dn->dn_allocated_txg = 0; | dn->dn_allocated_txg = 0; | ||||
dn->dn_free_txg = 0; | dn->dn_free_txg = 0; | ||||
dn->dn_have_spill = B_FALSE; | dn->dn_have_spill = B_FALSE; | ||||
dn->dn_num_slots = 1; | |||||
mutex_exit(&dn->dn_mtx); | mutex_exit(&dn->dn_mtx); | ||||
ASSERT(dn->dn_object != DMU_META_DNODE_OBJECT); | ASSERT(dn->dn_object != DMU_META_DNODE_OBJECT); | ||||
dnode_rele(dn, (void *)(uintptr_t)tx->tx_txg); | dnode_rele(dn, (void *)(uintptr_t)tx->tx_txg); | ||||
/* | /* | ||||
* Now that we've released our hold, the dnode may | * Now that we've released our hold, the dnode may | ||||
* be evicted, so we musn't access it. | * be evicted, so we musn't access it. | ||||
▲ Show 20 Lines • Show All 206 Lines • Show Last 20 Lines |