summaryrefslogtreecommitdiffstats
path: root/module/zfs/vdev_trim.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2020-03-04 15:07:11 -0800
committerGitHub <[email protected]>2020-03-04 15:07:11 -0800
commit2288d4196821ae4b5fa375e8e519f6e83f26abad (patch)
tree49c49baf2112da27d14ea2f90e09a333d1ab99da /module/zfs/vdev_trim.c
parentb3212d2fa6ab8d7d8373373e8a6b8acbbf45508e (diff)
Add trim support to zpool wait
Manual trims fall into the category of long-running pool activities which people might want to wait synchronously for. This change adds support to 'zpool wait' for waiting for manual trim operations to complete. It also adds a '-w' flag to 'zpool trim' which can be used to turn 'zpool trim' into a synchronous operation. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Serapheim Dimitropoulos <[email protected]> Signed-off-by: John Gallagher <[email protected]> Closes #10071
Diffstat (limited to 'module/zfs/vdev_trim.c')
-rw-r--r--module/zfs/vdev_trim.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/module/zfs/vdev_trim.c b/module/zfs/vdev_trim.c
index 7dec07e3c..137ba83df 100644
--- a/module/zfs/vdev_trim.c
+++ b/module/zfs/vdev_trim.c
@@ -346,6 +346,9 @@ vdev_trim_change_state(vdev_t *vd, vdev_trim_state_t new_state,
}
dmu_tx_commit(tx);
+
+ if (new_state != VDEV_TRIM_ACTIVE)
+ spa_notify_waiters(spa);
}
/*