Skip to content

Commit

Permalink
Add zfs.sh -r flag to reload modules
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Ryan Moeller authored and behlendorf committed Aug 31, 2021
1 parent 768ce47 commit 332a0bb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/zfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 332a0bb

Please sign in to comment.