xfs
[Top] [All Lists]

Re: [PATCH] xfstests: routine to create scratch of certain size

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH] xfstests: routine to create scratch of certain size
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Sat, 30 Jan 2010 05:19:51 -0500
Cc: xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <4B621D89.8070800@xxxxxxxxxxx>
References: <4B621D89.8070800@xxxxxxxxxxx>
User-agent: Mutt/1.5.19 (2009-01-05)
On Thu, Jan 28, 2010 at 05:28:09PM -0600, Eric Sandeen wrote:
> This is needed for later enospc tests to be generic
> 
> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxxx>
> ---
> 
> diff --git a/common.rc b/common.rc
> index 97513cc..cf2662a 100644
> --- a/common.rc
> +++ b/common.rc
> @@ -237,6 +237,27 @@ _scratch_mkfs_options()
>      echo $SCRATCH_OPTIONS $MKFS_OPTIONS $* $SCRATCH_DEV
>  }
>  
> +# arg 1 is size in bytes, arg 2 is (optional) blocksize
> +_scratch_mkfs_sized()
> +{
> +    fssz=$1
> +    bsz=$2
> +    [ -z "$bsz" ] && bsz=4096
> +    let blocks=$fssz/$bsz
> +
> +    case $FSTYP in
> +    xfs)
> +        _scratch_mkfs_xfs -d size=$fssz -b size=$bsz 2>&1 >>$here/$seq.full
> +    ;;
> +    ext2|ext3|ext4)
> +        /sbin/mkfs -t $FSTYP -- $MKFS_OPTIONS -b $bsz $SCRATCH_DEV $blocks  
> 2>&1>>$here/$seq.full
> +    ;;
> +    *)
> +    _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized"
> +    ;;
> +    esac
> +}

Looks good, the only questions is why you're using $MKFS_OPTIONS for
extN, but not for xfs?

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