@@ -1026,11 +1026,13 @@ _small_fs_size_mb()
}
# Create fs of certain size on scratch device
-# _try_scratch_mkfs_sized <size in bytes> [optional blocksize]
+# _try_scratch_mkfs_sized <size in bytes> [optional blocksize] [other options]
_try_scratch_mkfs_sized()
{
local fssize=$1
- local blocksize=$2
+ shift
+ local blocksize=$1
+ shift
local def_blksz
local blocksize_opt
local rt_ops
@@ -1094,10 +1096,10 @@ _try_scratch_mkfs_sized()
# don't override MKFS_OPTIONS that set a block size.
echo $MKFS_OPTIONS |grep -E -q "b\s*size="
if [ $? -eq 0 ]; then
- _try_scratch_mkfs_xfs -d size=$fssize $rt_ops
+ _try_scratch_mkfs_xfs -d size=$fssize $rt_ops "$@"
else
_try_scratch_mkfs_xfs -d size=$fssize $rt_ops \
- -b size=$blocksize
+ -b size=$blocksize "$@"
fi
;;
ext2|ext3|ext4)
@@ -1108,7 +1110,7 @@ _try_scratch_mkfs_sized()
_notrun "Could not make scratch logdev"
MKFS_OPTIONS="$MKFS_OPTIONS -J device=$SCRATCH_LOGDEV"
fi
- ${MKFS_PROG} -t $FSTYP -F $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
+ ${MKFS_PROG} -t $FSTYP -F $MKFS_OPTIONS -b $blocksize "$@" $SCRATCH_DEV $blocks
;;
gfs2)
# mkfs.gfs2 doesn't automatically shrink journal files on small
@@ -1123,13 +1125,13 @@ _try_scratch_mkfs_sized()
(( journal_size >= min_journal_size )) || journal_size=$min_journal_size
MKFS_OPTIONS="-J $journal_size $MKFS_OPTIONS"
fi
- ${MKFS_PROG} -t $FSTYP $MKFS_OPTIONS -O -b $blocksize $SCRATCH_DEV $blocks
+ ${MKFS_PROG} -t $FSTYP $MKFS_OPTIONS -O -b $blocksize "$@" $SCRATCH_DEV $blocks
;;
ocfs2)
- yes | ${MKFS_PROG} -t $FSTYP -F $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
+ yes | ${MKFS_PROG} -t $FSTYP -F $MKFS_OPTIONS -b $blocksize "$@" $SCRATCH_DEV $blocks
;;
udf)
- $MKFS_UDF_PROG $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
+ $MKFS_UDF_PROG $MKFS_OPTIONS -b $blocksize "$@" $SCRATCH_DEV $blocks
;;
btrfs)
local mixed_opt=
@@ -1137,33 +1139,33 @@ _try_scratch_mkfs_sized()
# the device is not zoned. Ref: btrfs-progs: btrfs_min_dev_size()
(( fssize < $((256 * 1024 * 1024)) )) &&
! _scratch_btrfs_is_zoned && mixed_opt='--mixed'
- $MKFS_BTRFS_PROG $MKFS_OPTIONS $mixed_opt -b $fssize $SCRATCH_DEV
+ $MKFS_BTRFS_PROG $MKFS_OPTIONS $mixed_opt -b $fssize "$@" $SCRATCH_DEV
;;
jfs)
- ${MKFS_PROG} -t $FSTYP $MKFS_OPTIONS $SCRATCH_DEV $blocks
+ ${MKFS_PROG} -t $FSTYP $MKFS_OPTIONS "$@" $SCRATCH_DEV $blocks
;;
reiserfs)
- ${MKFS_PROG} -t $FSTYP $MKFS_OPTIONS -b $blocksize $SCRATCH_DEV $blocks
+ ${MKFS_PROG} -t $FSTYP $MKFS_OPTIONS -b $blocksize "$@" $SCRATCH_DEV $blocks
;;
reiser4)
# mkfs.resier4 requires size in KB as input for creating filesystem
- $MKFS_REISER4_PROG $MKFS_OPTIONS -y -b $blocksize $SCRATCH_DEV \
+ $MKFS_REISER4_PROG $MKFS_OPTIONS -y -b $blocksize "$@" $SCRATCH_DEV \
`expr $fssize / 1024`
;;
f2fs)
# mkfs.f2fs requires # of sectors as an input for the size
local sector_size=`blockdev --getss $SCRATCH_DEV`
- $MKFS_F2FS_PROG $MKFS_OPTIONS $SCRATCH_DEV `expr $fssize / $sector_size`
+ $MKFS_F2FS_PROG $MKFS_OPTIONS "$@" $SCRATCH_DEV `expr $fssize / $sector_size`
;;
tmpfs)
local free_mem=`_free_memory_bytes`
if [ "$free_mem" -lt "$fssize" ] ; then
_notrun "Not enough memory ($free_mem) for tmpfs with $fssize bytes"
fi
- export MOUNT_OPTIONS="-o size=$fssize $TMPFS_MOUNT_OPTIONS"
+ export MOUNT_OPTIONS="-o size=$fssize "$@" $TMPFS_MOUNT_OPTIONS"
;;
bcachefs)
- $MKFS_BCACHEFS_PROG $MKFS_OPTIONS --fs_size=$fssize $blocksize_opt $SCRATCH_DEV
+ $MKFS_BCACHEFS_PROG $MKFS_OPTIONS --fs_size=$fssize $blocksize_opt "$@" $SCRATCH_DEV
;;
*)
_notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized"
@@ -1173,7 +1175,7 @@ _try_scratch_mkfs_sized()
_scratch_mkfs_sized()
{
- _try_scratch_mkfs_sized $* || _notrun "_scratch_mkfs_sized failed with ($*)"
+ _try_scratch_mkfs_sized "$@" || _notrun "_scratch_mkfs_sized failed with ($*)"
}
# Emulate an N-data-disk stripe w/ various stripe units