Add trim support to zpool wait
commit2288d4196821ae4b5fa375e8e519f6e83f26abad
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 4 Mar 2020 23:07:11 +0000 (4 15:07 -0800)
committerGitHub <noreply@github.com>
Wed, 4 Mar 2020 23:07:11 +0000 (4 15:07 -0800)
tree49c49baf2112da27d14ea2f90e09a333d1ab99da
parentb3212d2fa6ab8d7d8373373e8a6b8acbbf45508e
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
17 files changed:
cmd/zpool/zpool_main.c
include/libzfs.h
include/sys/fs/zfs.h
lib/libzfs/libzfs_pool.c
man/man8/zpool-trim.8
man/man8/zpool-wait.8
module/zfs/spa.c
module/zfs/vdev_trim.c
tests/runfiles/common.run
tests/zfs-tests/tests/functional/cli_root/zpool_wait/Makefile.am
tests/zfs-tests/tests/functional/cli_root/zpool_wait/zpool_wait_trim_basic.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/cli_root/zpool_wait/zpool_wait_trim_cancel.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/cli_root/zpool_wait/zpool_wait_trim_flag.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/trim/autotrim_trim_integrity.ksh
tests/zfs-tests/tests/functional/trim/trim.kshlib
tests/zfs-tests/tests/functional/trim/trim_config.ksh
tests/zfs-tests/tests/functional/trim/trim_integrity.ksh