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 <behlendorf1@llnl.gov>
Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com>
Signed-off-by: John Gallagher <john.gallagher@delphix.com>
Closes #10071
This commit is contained in:
Brian Behlendorf
2020-03-04 15:07:11 -08:00
committed by GitHub
parent b3212d2fa6
commit 2288d41968
17 changed files with 347 additions and 73 deletions
+5 -3
View File
@@ -27,7 +27,7 @@
.\" Copyright 2017 Nexenta Systems, Inc.
.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
.\"
.Dd August 9, 2019
.Dd February 25, 2020
.Dt ZPOOL-TRIM 8
.Os Linux
.Sh NAME
@@ -36,7 +36,7 @@
.Sh SYNOPSIS
.Nm
.Cm trim
.Op Fl d
.Op Fl dw
.Op Fl r Ar rate
.Op Fl c | Fl s
.Ar pool
@@ -46,7 +46,7 @@
.It Xo
.Nm
.Cm trim
.Op Fl d
.Op Fl dw
.Op Fl c | Fl s
.Ar pool
.Op Ar device Ns ...
@@ -84,6 +84,8 @@ trimmed, the command will fail and no suspension will occur on any device.
Trimming can then be resumed by running
.Nm zpool Cm trim
with no flags on the relevant target devices.
.It Fl w -wait
Wait until the devices are done being trimmed before returning.
.El
.El
.Sh SEE ALSO
+4 -2
View File
@@ -27,7 +27,7 @@
.\" Copyright 2017 Nexenta Systems, Inc.
.\" Copyright (c) 2017 Open-E, Inc. All Rights Reserved.
.\"
.Dd August 9, 2019
.Dd February 25, 2020
.Dt ZPOOL-WAIT 8
.Os Linux
.Sh NAME
@@ -73,6 +73,7 @@ along with what each one waits for:
remove Device removal to cease
resilver Resilver to cease
scrub Scrub to cease
trim Manual trim to cease
.Ed
.Pp
If an
@@ -109,4 +110,5 @@ See
.Xr zpool-replace 8 ,
.Xr zpool-remove 8 ,
.Xr zpool-resilver 8 ,
.Xr zpool-scrub 8
.Xr zpool-scrub 8 ,
.Xr zpool-trim 8