All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: xfs mailing list <xfs@oss.sgi.com>
Subject: [PATCH 1/3] xfstests: routine to create scratch of certain size
Date: Wed, 03 Feb 2010 15:37:13 -0600	[thread overview]
Message-ID: <4B69EC89.5050400@sandeen.net> (raw)
In-Reply-To: <4B69EC23.8040207@sandeen.net>

This is needed for later enospc tests to be generic

We have to explicitly call the mkfs rather than
_scratch_mkfs since extN wants nr-of-blocks as
an argument -after- the device name.

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

diff --git a/common.rc b/common.rc
index 1edea2f..0a02a2b 100644
--- a/common.rc
+++ b/common.rc
@@ -305,6 +305,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)
+	_scratch_mkfs_xfs -d size=$fssize -b size=$blocksize
+	;;
+    ext2|ext3|ext4)
+	/sbin/mkfs.$FSTYP -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

  reply	other threads:[~2010-02-03 21:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-03 21:35 [PATCH 0/3] resending a few xfstests patches as a series Eric Sandeen
2010-02-03 21:37 ` Eric Sandeen [this message]
2010-02-05  9:37   ` [PATCH 1/3] xfstests: routine to create scratch of certain size Christoph Hellwig
2010-02-03 21:38 ` [PATCH 2/3] xfstests: make 053 and 077 generic Eric Sandeen
2010-02-05  9:37   ` Christoph Hellwig
2010-02-03 21:41 ` [PATCH 3/3] xfstests: rename _acl_requirements to _require_acls Eric Sandeen
2010-02-05  9:38   ` Christoph Hellwig

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=4B69EC89.5050400@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 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.