xfs
[Top] [All Lists]

[PATCH 1/2] xfstests: Add JFS _scratch_mkfs external journal support

To: xfs-oss <xfs@xxxxxxxxxxx>
Subject: [PATCH 1/2] xfstests: Add JFS _scratch_mkfs external journal support
From: "Michael L. Semon" <mlsemon35@xxxxxxxxx>
Date: Fri, 06 Sep 2013 16:59:23 -0400
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=gHjP6iMQz/rLA52J7x+UooY0/ma0ISHdCpihOchzFpI=; b=bTQBHs1NXT5RQVfWAci63ozy2YX+jBkLgSURCwai9EJ4zLp2LWzbJUwY/gFhaB8B2D wZnCC7yVlJnnje/Pe/3nua/3CrsJLaiVVXIda0DOL8f46FWAcqyUSBjb/1uvXJlMckPj Ktp6h9S3w+rqX27QweKfvuYYgbmw/5gCRDybEGaWIANHEX9IVCU7masGrKz00o7V6Jkj Q1BEzdX0kjtp5Jb9hcC/WkW3uJHsz/D/B7UqMZC+emFWRBua88rJcBwRUJzBoGJI8iJK SC/G9OY1tMwOyky7it9xcRJy6yrjTjT03LLRwy5OGKTepHYxtcssiWu8DbTnL8FBGVIH bKJg==
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
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@xxxxxxxxx>
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


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH 1/2] xfstests: Add JFS _scratch_mkfs external journal support, Michael L. Semon <=