public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael L. Semon" <mlsemon35@gmail.com>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH 1/2] xfstests: Add JFS _scratch_mkfs external journal support
Date: Fri, 06 Sep 2013 16:59:23 -0400	[thread overview]
Message-ID: <522A422B.2030401@gmail.com> (raw)

Hi!  I'd like to contribute several patches for better JFS support.  
This is tested against JFS and XFS.  It's a bit of copy, paste, and 
adaptation until it worked well.  Sorry to nest the XFS code in a 
switch case:  It was the only attempt at coding it that didn't look 
silly.

Thanks!

Michael

>From 52ce69861e7a261449589fdb13c8a8f88df476fa Mon Sep 17 00:00:00 2001
From: "Michael L. Semon" <mlsemon35@gmail.com>
Date: Fri, 6 Sep 2013 03:04:25 -0400
Subject: [PATCH 1/2] xfstests: Add JFS _scratch_mkfs external journal support

Add _scratch_mkfs external journal support for JFS.  Try to respect the
USE_EXTERNAL and SCRATCH_LOGDEV variables like the XFS support.
---
 common/config |  1 +
 common/rc     | 52 ++++++++++++++++++++++++++++++++++++----------------
 2 files changed, 37 insertions(+), 16 deletions(-)

diff --git a/common/config b/common/config
index db086fb..bdd1add 100644
--- a/common/config
+++ b/common/config
@@ -204,6 +204,7 @@ case "$HOSTOS" in
         ;;
     Linux)
         export MKFS_XFS_PROG="`set_prog_path mkfs.xfs`"
+        export MKFS_JFS_PROG="`set_prog_path mkfs.jfs`"
         export MKFS_UDF_PROG="`set_prog_path mkudffs`"
         export MKFS_BTRFS_PROG="`set_btrfs_mkfs_prog_path_with_opts`"
         export BTRFS_UTIL_PROG="`set_prog_path btrfs`"
diff --git a/common/rc b/common/rc
index 8a239c5..191e9e5 100644
--- a/common/rc
+++ b/common/rc
@@ -207,25 +207,33 @@ _scratch_options()
     type=$1
     SCRATCH_OPTIONS=""
 
-    if [ "$FSTYP" != "xfs" ]; then
-        return
-    fi
-
-    case $type in
-    mkfs)
-	[ "$HOSTOS" != "IRIX" ] && SCRATCH_OPTIONS="$SCRATCH_OPTIONS -f"
-	rt_opt="-r"
-        log_opt="-l"
+    case $FSTYP in
+    xfs)
+	case $type in
+	mkfs)
+	    [ "$HOSTOS" != "IRIX" ] && SCRATCH_OPTIONS="$SCRATCH_OPTIONS -f"
+	    rt_opt="-r"
+            log_opt="-l"
+	    ;;
+	mount)
+	    rt_opt="-o"
+            log_opt="-o"
+	    ;;
+	esac
+	[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \
+	    SCRATCH_OPTIONS="$SCRATCH_OPTIONS ${rt_opt}rtdev=$SCRATCH_RTDEV"
+	[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+	    SCRATCH_OPTIONS="$SCRATCH_OPTIONS ${log_opt}logdev=$SCRATCH_LOGDEV"
 	;;
-    mount)
-	rt_opt="-o"
-        log_opt="-o"
+    jfs)
+	if [ "$type" == "mkfs" ]; then
+	    [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
+		SCRATCH_OPTIONS="$SCRATCH_OPTIONS -j $SCRATCH_LOGDEV"
+	fi
+	;;
+    *)
 	;;
     esac
-    [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_RTDEV" ] && \
-	SCRATCH_OPTIONS="$SCRATCH_OPTIONS ${rt_opt}rtdev=$SCRATCH_RTDEV"
-    [ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
-	SCRATCH_OPTIONS="$SCRATCH_OPTIONS ${log_opt}logdev=$SCRATCH_LOGDEV"
 }
 
 _test_options()
@@ -526,6 +534,15 @@ _scratch_mkfs_ext4()
 	return $mkfs_status
 }
 
+_scratch_mkfs_jfs()
+{
+    _scratch_options mkfs
+
+    $MKFS_JFS_PROG $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV > /dev/null
+
+    return $?
+}
+
 _scratch_mkfs()
 {
     case $FSTYP in
@@ -544,6 +561,9 @@ _scratch_mkfs()
     ext4)
 	_scratch_mkfs_ext4 $*
 	;;
+    jfs)
+        _scratch_mkfs_jfs $*
+	;;
     *)
 	yes | $MKFS_PROG -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV
 	;;
-- 
1.8.3.2


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

                 reply	other threads:[~2013-09-06 20:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=522A422B.2030401@gmail.com \
    --to=mlsemon35@gmail.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox