Skip to content

Commit 332a0bb

Browse files
Ryan Moellerbehlendorf
authored andcommitted
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 <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #12450
1 parent 768ce47 commit 332a0bb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

scripts/zfs.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ fi
1414
PROG=zfs.sh
1515
VERBOSE="no"
1616
UNLOAD="no"
17+
LOAD="yes"
1718
STACK_TRACER="no"
1819

1920
ZED_PIDFILE=${ZED_PIDFILE:-/var/run/zed.pid}
@@ -44,12 +45,13 @@ DESCRIPTION:
4445
OPTIONS:
4546
-h Show this message
4647
-v Verbose
48+
-r Reload modules
4749
-u Unload modules
4850
-S Enable kernel stack tracer
4951
EOF
5052
}
5153

52-
while getopts 'hvuS' OPTION; do
54+
while getopts 'hvruS' OPTION; do
5355
case $OPTION in
5456
h)
5557
usage
@@ -58,8 +60,13 @@ while getopts 'hvuS' OPTION; do
5860
v)
5961
VERBOSE="yes"
6062
;;
63+
r)
64+
UNLOAD="yes"
65+
LOAD="yes"
66+
;;
6167
u)
6268
UNLOAD="yes"
69+
LOAD="no"
6370
;;
6471
S)
6572
STACK_TRACER="yes"
@@ -262,7 +269,8 @@ if [ "$UNLOAD" = "yes" ]; then
262269
unload_modules_linux
263270
;;
264271
esac
265-
else
272+
fi
273+
if [ "$LOAD" = "yes" ]; then
266274
case $UNAME in
267275
FreeBSD)
268276
load_modules_freebsd

0 commit comments

Comments
 (0)