* [PATCH 1/2] xfstests: Add JFS _scratch_mkfs external journal support
@ 2013-09-06 20:59 Michael L. Semon
0 siblings, 0 replies; only message in thread
From: Michael L. Semon @ 2013-09-06 20:59 UTC (permalink / raw)
To: xfs-oss
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2013-09-06 20:59 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-06 20:59 [PATCH 1/2] xfstests: Add JFS _scratch_mkfs external journal support Michael L. Semon
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.