xfs
[Top] [All Lists]

[PATCH v2 02/12] xfstests: _scratch_mkfs_sized() for tmpfs

To: xfs@xxxxxxxxxxx
Subject: [PATCH v2 02/12] xfstests: _scratch_mkfs_sized() for tmpfs
From: Junho Ryu <jayr@xxxxxxxxxx>
Date: Tue, 17 Dec 2013 14:18:32 -0800
Cc: branto@xxxxxxxxxx, hughd@xxxxxxxxxx, tytso@xxxxxxx, Junho Ryu <jayr@xxxxxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QgsmONKBx62woF2aVwoyaGCf2lM9Myh2AsL82RQnAG0=; b=ojcD2NaSLlipqzOWnI43u1IeB+Z7s98XWRKalANsR+RIWLfnR+unJ01Ea7OS3tT19g 9dzqRnFVnEzfJhzlN8hSS7Pa3nHyNqbITHHxSmhh2kTTBUWBt6W5r/PNUnDBO2kq3rnw OaSHmifmEZm3+9aWdmKtuXeeQ6sLFIqulSskcg2DyzUJaEFHYAHn0xvir1A0pQ9L7uNh /JSA0PsnYvYNedUVtXF2AQhbmm1nMFTX0JCnDuOY4fz4e8McDFhE1pmDfOM3cl4UfD6u Jcy+KXxpY1NkYPK0DMte66BntPYSs+gpAfO+sXGXuWomE/k7KXMuywKCxFfsNlKdf1DD 8fQw==
In-reply-to: <1387318722-3050-1-git-send-email-jayr@xxxxxxxxxx>
References: <1387318722-3050-1-git-send-email-jayr@xxxxxxxxxx>
From: Hugh Dickins <hughd@xxxxxxxxxx>

_scratch_mkfs_sized() avoid blockdev and update MOUNT_OPTIONS with
required size on tmpfs, so those tests using it can now run.

Signed-off-by: Hugh Dickins <hughd@xxxxxxxxxx>
Signed-off-by: Junho Ryu <jayr@xxxxxxxxxx>
---

v2: same as v1

 common/rc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/rc b/common/rc
index a2005c9..c78356e 100644
--- a/common/rc
+++ b/common/rc
@@ -590,7 +590,7 @@ _scratch_mkfs_sized()
 
     blocks=`expr $fssize / $blocksize`
 
-    if [ "$HOSTOS" == "Linux" ]; then
+    if [ "$HOSTOS" == "Linux" -a -d "$SCRATCH_DEV" ]; then
        devsize=`blockdev --getsize64 $SCRATCH_DEV`
        [ "$fssize" -gt "$devsize" ] && _notrun "Scratch device too small"
     fi
@@ -611,6 +611,9 @@ _scratch_mkfs_sized()
     btrfs)
        $MKFS_BTRFS_PROG $MKFS_OPTIONS -b $fssize $SCRATCH_DEV
        ;;
+    tmpfs)
+       export MOUNT_OPTIONS="-o size=$fssize $TMPFS_MOUNT_OPTIONS"
+       ;;
     *)
        _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized"
        ;;
-- 
1.8.5.1

<Prev in Thread] Current Thread [Next in Thread>