* Wait for the vdev_autotrim_thread associated with the passed top-level * vdev to be terminated (canceled or stopped). */
| 1471 | * vdev to be terminated (canceled or stopped). |
| 1472 | */ |
| 1473 | void |
| 1474 | vdev_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 |
no test coverage detected