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

Function vdev_rebuild_active

freebsd/contrib/openzfs/module/zfs/vdev_rebuild.c:954–976  ·  view source on GitHub ↗

* Returns B_TRUE if any top-level vdev are rebuilding. */

Source from the content-addressed store, hash-verified

952 * Returns B_TRUE if any top-level vdev are rebuilding.
953 */
954boolean_t
955vdev_rebuild_active(vdev_t *vd)
956{
957 spa_t *spa = vd->vdev_spa;
958 boolean_t ret = B_FALSE;
959
960 if (vd == spa->spa_root_vdev) {
961 for (uint64_t i = 0; i < vd->vdev_children; i++) {
962 ret = vdev_rebuild_active(vd->vdev_child[i]);
963 if (ret)
964 return (ret);
965 }
966 } else if (vd->vdev_top_zap != 0) {
967 vdev_rebuild_t *vr = &vd->vdev_rebuild_config;
968 vdev_rebuild_phys_t *vrp = &vr->vr_rebuild_phys;
969
970 mutex_enter(&vd->vdev_rebuild_lock);
971 ret = (vrp->vrp_rebuild_state == VDEV_REBUILD_ACTIVE);
972 mutex_exit(&vd->vdev_rebuild_lock);
973 }
974
975 return (ret);
976}
977
978/*
979 * Start a rebuild operation. The rebuild may be restarted when the

Callers 6

spa_load_implFunction · 0.85
spa_vdev_attachFunction · 0.85
spa_async_threadFunction · 0.85
spa_activity_in_progressFunction · 0.85
dsl_scan_setup_checkFunction · 0.85

Calls 2

mutex_enterFunction · 0.85
mutex_exitFunction · 0.85

Tested by

no test coverage detected