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

Function vdev_replace_in_progress

freebsd/contrib/openzfs/module/zfs/vdev.c:5177–5200  ·  view source on GitHub ↗

* Look at the vdev tree and determine whether any devices are currently being * replaced. */

Source from the content-addressed store, hash-verified

5175 * replaced.
5176 */
5177boolean_t
5178vdev_replace_in_progress(vdev_t *vdev)
5179{
5180 ASSERT(spa_config_held(vdev->vdev_spa, SCL_ALL, RW_READER) != 0);
5181
5182 if (vdev->vdev_ops == &vdev_replacing_ops)
5183 return (B_TRUE);
5184
5185 /*
5186 * A 'spare' vdev indicates that we have a replace in progress, unless
5187 * it has exactly two children, and the second, the hot spare, has
5188 * finished being resilvered.
5189 */
5190 if (vdev->vdev_ops == &vdev_spare_ops && (vdev->vdev_children > 2 ||
5191 !vdev_dtl_empty(vdev->vdev_child[1], DTL_MISSING)))
5192 return (B_TRUE);
5193
5194 for (int i = 0; i < vdev->vdev_children; i++) {
5195 if (vdev_replace_in_progress(vdev->vdev_child[i]))
5196 return (B_TRUE);
5197 }
5198
5199 return (B_FALSE);
5200}
5201
5202EXPORT_SYMBOL(vdev_fault);
5203EXPORT_SYMBOL(vdev_degrade);

Callers 1

spa_activity_in_progressFunction · 0.85

Calls 2

spa_config_heldFunction · 0.85
vdev_dtl_emptyFunction · 0.85

Tested by

no test coverage detected