aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
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 'include')
-rw-r--r--include/libzfs.h3
-rw-r--r--include/sys/fs/zfs.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/include/libzfs.h b/include/libzfs.h
index 05abfdf89..7f728e3a5 100644
--- a/include/libzfs.h
+++ b/include/libzfs.h
@@ -269,6 +269,9 @@ typedef struct trimflags {
/* request a secure trim, requires support from device */
boolean_t secure;
+ /* after starting trim, block until trim completes */
+ boolean_t wait;
+
/* trim at the requested rate in bytes/second */
uint64_t rate;
} trimflags_t;
diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h
index f5d8ba953..2c7fd8162 100644
--- a/include/sys/fs/zfs.h
+++ b/include/sys/fs/zfs.h
@@ -1353,6 +1353,7 @@ typedef enum {
ZPOOL_WAIT_REMOVE,
ZPOOL_WAIT_RESILVER,
ZPOOL_WAIT_SCRUB,
+ ZPOOL_WAIT_TRIM,
ZPOOL_WAIT_NUM_ACTIVITIES
} zpool_wait_activity_t;