[PATCH 5/9] Set up testdir for generic filesystems

Eric Sandeen sandeen at sandeen.net
Wed May 27 13:53:29 CDT 2009


Make the default filesystem testdir setup the same as
what xfs did; simply set up the testdir variable.

Update the comment for UDF & NFS, as to why they are
currently doing something different.

Signed-off-by: Eric Sandeen <sandeen at sandeen.net>
---
 common.rc |   31 ++++++++++---------------------
 1 files changed, 10 insertions(+), 21 deletions(-)

diff --git a/common.rc b/common.rc
index f649bc2..78514f4 100644
--- a/common.rc
+++ b/common.rc
@@ -988,15 +988,6 @@ _check_testdir()
     esac
 }
 
-
-_setup_xfs_testdir()
-{
-    [ "$FSTYP" != "xfs" ] \
-	&& _fail "setup_xfs_testdir: \$FSTYP ($FSTYP) is not xfs"
-
-    testdir=$TEST_DIR
-}
-
 _setup_udf_scratchdir()
 {
     [ "$FSTYP" != "udf" ] \
@@ -1050,16 +1041,17 @@ _setup_nfs_scratchdir()
 }
 
 #
-# Warning for UDF and NFS this function calls _setup_udf_scratchdir and
-# _setup_udf_scratchdir. This is done because testdir is a persistent
-# XFS only partition.
+# Warning for UDF and NFS:
+# this function calls _setup_udf_scratchdir and _setup_udf_scratchdir
+# which actually uses the scratch dir for the test dir.
+#
+# This was done because testdir was intended to be a persistent
+# XFS only partition.  This should eventually change, and treat
+# at least local filesystems all the same.
 #
 _setup_testdir()
 {
     case $FSTYP in
-    xfs)
-	_setup_xfs_testdir
-	;;
     udf)
 	_setup_udf_scratchdir
 	;;
@@ -1067,7 +1059,7 @@ _setup_testdir()
 	_setup_nfs_scratchdir
 	;;
     *)
-	_fail "\$FSTYP is not xfs, udf or nfs"
+	testdir=$TEST_DIR
 	;;
     esac
 }
@@ -1075,10 +1067,6 @@ _setup_testdir()
 _cleanup_testdir()
 {
     case $FSTYP in
-    xfs)
-	# do nothing, testdir is $TEST_DIR
-	:
-	;;
     udf)
 	# umount testdir as it is $SCRATCH_MNT which could be used by xfs next
 	[ -n "$testdir" ] && $UMOUNT_PROG $testdir
@@ -1088,7 +1076,8 @@ _cleanup_testdir()
 	[ -n "$testdir" ] && $UMOUNT_PROG $testdir
 	;;
     *)
-	_fail "\$FSTYP is not xfs, udf or nfs"
+	# do nothing, testdir is $TEST_DIR
+	:
 	;;
     esac
 }
-- 
1.5.5.6




More information about the xfs mailing list