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

Function vdev_autotrim_stop_wait

freebsd/contrib/openzfs/module/zfs/vdev_trim.c:1473–1489  ·  view source on GitHub ↗

* Wait for the vdev_autotrim_thread associated with the passed top-level * vdev to be terminated (canceled or stopped). */

Source from the content-addressed store, hash-verified

1471 * vdev to be terminated (canceled or stopped).
1472 */
1473void
1474vdev_autotrim_stop_wait(vdev_t *tvd)
1475{
1476 mutex_enter(&tvd->vdev_autotrim_lock);
1477 if (tvd->vdev_autotrim_thread != NULL) {
1478 tvd->vdev_autotrim_exit_wanted = B_TRUE;
1479
1480 while (tvd->vdev_autotrim_thread != NULL) {
1481 cv_wait(&tvd->vdev_autotrim_cv,
1482 &tvd->vdev_autotrim_lock);
1483 }
1484
1485 ASSERT3P(tvd->vdev_autotrim_thread, ==, NULL);
1486 tvd->vdev_autotrim_exit_wanted = B_FALSE;
1487 }
1488 mutex_exit(&tvd->vdev_autotrim_lock);
1489}
1490
1491/*
1492 * Wait for all of the vdev_autotrim_thread associated with the pool to

Callers 4

spa_vdev_config_exitFunction · 0.85
vdev_autotrim_stop_allFunction · 0.85
spa_vdev_remove_logFunction · 0.85
spa_vdev_remove_topFunction · 0.85

Calls 3

mutex_enterFunction · 0.85
cv_waitFunction · 0.85
mutex_exitFunction · 0.85

Tested by

no test coverage detected