Add zfs.sh -r flag to reload modules

zfs.sh already can load and unload, so why not both?

This is convenient when developing changes to the module and you want
to rapidly make some changes, rebuild the module, reload the module,
and test the changes.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #12450
This commit is contained in:
Ryan Moeller 2021-08-13 16:37:46 -04:00 committed by GitHub
parent a7491f9990
commit 6daf036ab5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -14,6 +14,7 @@ fi
PROG=zfs.sh
VERBOSE="no"
UNLOAD="no"
LOAD="yes"
STACK_TRACER="no"
ZED_PIDFILE=${ZED_PIDFILE:-/var/run/zed.pid}
@ -44,12 +45,13 @@ DESCRIPTION:
OPTIONS:
-h Show this message
-v Verbose
-r Reload modules
-u Unload modules
-S Enable kernel stack tracer
EOF
}
while getopts 'hvuS' OPTION; do
while getopts 'hvruS' OPTION; do
case $OPTION in
h)
usage
@ -58,8 +60,13 @@ while getopts 'hvuS' OPTION; do
v)
VERBOSE="yes"
;;
r)
UNLOAD="yes"
LOAD="yes"
;;
u)
UNLOAD="yes"
LOAD="no"
;;
S)
STACK_TRACER="yes"
@ -262,7 +269,8 @@ if [ "$UNLOAD" = "yes" ]; then
unload_modules_linux
;;
esac
else
fi
if [ "$LOAD" = "yes" ]; then
case $UNAME in
FreeBSD)
load_modules_freebsd