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

Function load_concrete_ms_allocatable_trees

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

Source from the content-addressed store, hash-verified

5731}
5732
5733static void
5734load_concrete_ms_allocatable_trees(spa_t *spa, maptype_t maptype)
5735{
5736 vdev_t *rvd = spa->spa_root_vdev;
5737 for (uint64_t i = 0; i < rvd->vdev_children; i++) {
5738 vdev_t *vd = rvd->vdev_child[i];
5739
5740 ASSERT3U(i, ==, vd->vdev_id);
5741
5742 if (vd->vdev_ops == &vdev_indirect_ops)
5743 continue;
5744
5745 for (uint64_t m = 0; m < vd->vdev_ms_count; m++) {
5746 metaslab_t *msp = vd->vdev_ms[m];
5747
5748 (void) fprintf(stderr,
5749 "\rloading concrete vdev %llu, "
5750 "metaslab %llu of %llu ...",
5751 (longlong_t)vd->vdev_id,
5752 (longlong_t)msp->ms_id,
5753 (longlong_t)vd->vdev_ms_count);
5754
5755 mutex_enter(&msp->ms_lock);
5756 range_tree_vacate(msp->ms_allocatable, NULL, NULL);
5757
5758 /*
5759 * We don't want to spend the CPU manipulating the
5760 * size-ordered tree, so clear the range_tree ops.
5761 */
5762 msp->ms_allocatable->rt_ops = NULL;
5763
5764 if (msp->ms_sm != NULL) {
5765 VERIFY0(space_map_load(msp->ms_sm,
5766 msp->ms_allocatable, maptype));
5767 }
5768 if (!msp->ms_loaded)
5769 msp->ms_loaded = B_TRUE;
5770 mutex_exit(&msp->ms_lock);
5771 }
5772 }
5773
5774 load_unflushed_to_ms_allocatables(spa, maptype);
5775}
5776
5777/*
5778 * vm_idxp is an in-out parameter which (for indirect vdevs) is the

Callers 3

zdb_leak_initFunction · 0.85

Calls 5

mutex_enterFunction · 0.85
range_tree_vacateFunction · 0.85
space_map_loadFunction · 0.85
mutex_exitFunction · 0.85

Tested by

no test coverage detected