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

Christoph Hellwig hch at infradead.org
Sat Jan 30 04:19:51 CST 2010


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 at sandeen.net>
> ---
> 
> 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?




More information about the xfs mailing list