xfs
[Top] [All Lists]

[PATCH 03/10] xfstests: _scratch_mkfs_sized() for tmpfs

To: xfs@xxxxxxxxxxx
Subject: [PATCH 03/10] xfstests: _scratch_mkfs_sized() for tmpfs
From: Junho Ryu <jayr@xxxxxxxxxx>
Date: Tue, 10 Dec 2013 12:11:54 -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=empGQbZaupR+CqvNIefRGaU80Zximbhjc2CaBlEx9mU=; b=OG1OYoRRhJLDpO4aMiUUzU1AYiYIpHKA5pUlyhdZz99CtZUUIWYaAh2UPe4xfSlQeR j5ekEsT+26CbAFayLEcwGnnMzt5VHrD04bIkRF3+s8xevbX6HqXm0wbYUigOmfbykK9c kmm/nuIMqnxTV2s+174RSmXGZfW6AhLQ7wH/DLY8kdXOV3TcNDGU79KPCdfkbMj89vMI fnLbIiQhmReCeHZf+Nu1SkdKXsMbpMqPPAtd7Aq6W1jBWaAn6XGGm0lejcRyDH7QTEI9 WbUs1uf8wlS5cMfwgx+kLpDi8XaLb2pVNNk56ty6hDV+6THG6C1mdI8Hj1DPjpE9R5A8 hhWA==
In-reply-to: <1386706321-15795-1-git-send-email-jayr@xxxxxxxxxx>
References: <1386706321-15795-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>
---
 common/rc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/rc b/common/rc
index a2005c9..83d56a1 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 "$FSTYP" != "tmpfs" ]; 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>