public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH V2] xfstests: routine to create scratch of certain size
Date: Tue, 02 Feb 2010 19:54:34 -0600	[thread overview]
Message-ID: <4B68D75A.9020105@sandeen.net> (raw)
In-Reply-To: <4B621D89.8070800@sandeen.net>

This is needed for later enospc tests to be generic

Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---

V2: Address Christoph's comment about use of MKFS_OPTIONS;
just do it like the other geom helper and explicitly -set-
MKFS_OPTIONS for scratch, to set the size, then just call
_scratch_mkfs

(this would override any global MKFS_OPTIONS setting, but
I think that's ok for now, and not sure how these options might
interact w/ previously set MKFS_OPTIONS anyway)

diff --git a/common.rc b/common.rc
index 9c375dc..a6526a3 100644
--- a/common.rc
+++ b/common.rc
@@ -297,6 +297,29 @@ _scratch_mkfs()
     esac
 }
 
+# Create fs of certain size on scratch device
+# _scratch_mkfs_sized <size in bytes> [optional blocksize]
+_scratch_mkfs_sized()
+{
+    fssize=$1
+    blocksize=$2
+    [ -z "$blocksize" ] && blocksize=4096
+    let blocks=$fssize/$blocksize
+
+    case $FSTYP in
+    xfs)
+	MKFS_OPTIONS="-d size=$fssize -b size=$blocksize"
+	;;
+    ext2|ext3|ext4)
+	MKFS_OPTIONS="-b $blocksize $SCRATCH_DEV $blocks"
+	;;
+    *)
+	_notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized"
+	;;
+    esac
+    _scratch_mkfs
+}
+
 # Emulate an N-data-disk stripe w/ various stripe units
 # _scratch_mkfs_geom <sunit bytes> <swidth multiplier> [optional blocksize]
 _scratch_mkfs_geom()


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

  parent reply	other threads:[~2010-02-03  1:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-28 23:28 [PATCH] xfstests: routine to create scratch of certain size Eric Sandeen
2010-01-30 10:19 ` Christoph Hellwig
2010-01-30 16:03   ` Eric Sandeen
2010-02-03  1:54 ` Eric Sandeen [this message]
2010-02-03  2:49   ` [PATCH V2] " Eric Sandeen

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=4B68D75A.9020105@sandeen.net \
    --to=sandeen@sandeen.net \
    --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