From: adilger Date: Wed, 29 May 2002 10:04:37 +0000 (+0000) Subject: Add mds filesystem helper modules to setup and cleanup. X-Git-Tag: 0.4.2~230 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=473cf61089b937be5da28d9fef79690d57d76050;p=fs%2Flustre-release.git Add mds filesystem helper modules to setup and cleanup. --- diff --git a/lustre/tests/common.sh b/lustre/tests/common.sh index df65a1d..eb5d156 100644 --- a/lustre/tests/common.sh +++ b/lustre/tests/common.sh @@ -27,8 +27,8 @@ do_insmod() { [ "$MODULE" ] || fail "usage: $0 " [ -f $MODULE ] || fail "$0: module '$MODULE' not found" - lsmod | grep -q "\<$BASE\>" && return 1 - insmod $MODULE || exit -1 + lsmod | grep -q "\<$BASE\>" && return 0 + insmod $MODULE } # Return the next unused loop device on stdout and in the $LOOPDEV @@ -50,6 +50,11 @@ next_loop_dev() { # filesystem on a device we use mkfs, because that only writes sparsely # to the device. The empty filesystems are also highly compressed (1000:1) # so they don't take too much space. +# +new_fs_usage() { + echo "new_fs {device | file} [size]" 1>&2 + exit -1 +} new_fs () { EFILE="$1_$3.gz" MKFS="mkfs.$1" @@ -58,13 +63,11 @@ new_fs () { [ "$1" = "ext3" ] && MKFS="mkfs.ext2 -j" if [ "$1" = "extN" ]; then MKFS="mkfs.ext2 -j" - EFILE="$1_ext3.gz" - do_insmod $LUSTRE/extN/extN.o + EFILE="ext3_$3.gz" fi if [ -b "$2" ]; then - [ $# -lt 2 -o $# -gt 3 ] && \ - echo "usage: $0 [size]" 1>&2 && exit -1 + [ $# -lt 2 -o $# -gt 3 ] && new_fs_usage PM="/proc/mounts" [ -r "$PM" ] || PM="/etc/mtab" @@ -74,8 +77,7 @@ new_fs () { $MKFS $MKFSOPT $2 $3 || exit -1 LOOPDEV=$2 # Not really a loop device else - [ $# -ne 3 ] && \ - echo "usage: $0 " 1>&2 && exit -1 + [ $# -ne 3 ] && new_fs_usage if [ -r "$EFILE" ]; then echo "using prepared filesystem $EFILE for $2" @@ -97,8 +99,6 @@ new_fs () { old_fs () { [ -e $2 ] || exit -1 - [ "$1" = "extN" ] && do_insmod $LUSTRE/extN/extN.o - if [ -b "$2" ]; then LOOPDEV=$2 # Not really a loop device else @@ -160,14 +160,14 @@ setup_portals() { [ -c /dev/portals ] || mknod /dev/portals c 10 240 - do_insmod $PORTALS/linux/oslib/portals.o + do_insmod $PORTALS/linux/oslib/portals.o || exit -1 case $NETWORK in elan) [ "$PORT" ] && fail "$0: NETWORK is elan but PORT is set" - do_insmod $PORTALS/linux/qswnal/kqswnal.o + do_insmod $PORTALS/linux/qswnal/kqswnal.o || exit -1 ;; tcp) [ "$PORT" ] || fail "$0: NETWORK is tcp but PORT is not set" - do_insmod $PORTALS/linux/socknal/ksocknal.o + do_insmod $PORTALS/linux/socknal/ksocknal.o || exit -1 $ACCEPTOR $PORT ;; *) fail "$0: unknown NETWORK '$NETWORK'" ;; @@ -190,18 +190,21 @@ setup_portals() { setup_lustre() { [ -c /dev/obd ] || mknod /dev/obd c 10 241 - do_insmod $LUSTRE/class/obdclass.o - do_insmod $LUSTRE/rpc/ptlrpc.o - do_insmod $LUSTRE/ldlm/ldlm.o + do_insmod $LUSTRE/class/obdclass.o || exit -1 + do_insmod $LUSTRE/rpc/ptlrpc.o || exit -1 + do_insmod $LUSTRE/ldlm/ldlm.o || exit -1 do_insmod $LUSTRE/extN/extN.o - do_insmod $LUSTRE/mds/mds.o - do_insmod $LUSTRE/obdecho/obdecho.o - do_insmod $LUSTRE/ext2obd/obdext2.o - do_insmod $LUSTRE/filterobd/obdfilter.o - do_insmod $LUSTRE/ost/ost.o - do_insmod $LUSTRE/osc/osc.o - do_insmod $LUSTRE/mdc/mdc.o - do_insmod $LUSTRE/llight/llite.o + do_insmod $LUSTRE/mds/mds.o || exit -1 + do_insmod $LUSTRE/mds/mds_ext2.o || exit -1 + do_insmod $LUSTRE/mds/mds_ext3.o || exit -1 + do_insmod $LUSTRE/mds/mds_extN.o + do_insmod $LUSTRE/obdecho/obdecho.o || exit -1 + do_insmod $LUSTRE/ext2obd/obdext2.o || exit -1 + do_insmod $LUSTRE/filterobd/obdfilter.o || exit -1 + do_insmod $LUSTRE/ost/ost.o || exit -1 + do_insmod $LUSTRE/osc/osc.o || exit -1 + do_insmod $LUSTRE/mdc/mdc.o || exit -1 + do_insmod $LUSTRE/llight/llite.o || exit -1 list_mods @@ -414,6 +417,9 @@ cleanup_lustre() { rmmod llite rmmod mdc + rmmod mds_extN + rmmod mds_ext3 + rmmod mds_ext2 rmmod mds rmmod ost rmmod osc diff --git a/lustre/tests/llmountcleanup.sh b/lustre/tests/llmountcleanup.sh index 11de094..ad48b47 100755 --- a/lustre/tests/llmountcleanup.sh +++ b/lustre/tests/llmountcleanup.sh @@ -36,6 +36,9 @@ quit EOF rmmod obdecho +rmmod mds_extN +rmmod mds_ext3 +rmmod mds_ext2 rmmod mds rmmod osc rmmod ost