This patch reduces code duplication.
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
# Functions and global variables used by both the srp and nvmeof-mp tests.
. common/shellcheck
+. common/null_blk
debug=
filesystem_type=ext4
ls -l /dev/nullb* &>>"$FULL"
}
-unload_null_blk() {
- local d
-
- for d in /sys/kernel/config/nullb/*; do [ -d "$d" ] && rmdir "$d"; done
- unload_module null_blk
-}
-
setup_rdma() {
start_soft_rdma
(
rm -f /etc/multipath.conf
stop_target
stop_soft_rdma
- unload_null_blk
+ _exit_null_blk
}
teardown() {
[ -e "/sys/module/$m" ] || modprobe "$m" || return $?
done
- modprobe null_blk nr_devices=0 || return $?
+ _init_null_blk nr_devices=0 || return $?
configure_null_blk || return $?
)
unload_module nvmet_rdma &&
unload_module nvmet &&
- unload_null_blk
+ _exit_null_blk
}
start_target() {