This is needed for later enospc tests to be generic
Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxxx>
V2: Address Christoph's comment about use of MKFS_OPTIONS;
just do it like the other geom helper and explicitly -set-
MKFS_OPTIONS for scratch, to set the size, then just call
(this would override any global MKFS_OPTIONS setting, but
I think that's ok for now, and not sure how these options might
interact w/ previously set MKFS_OPTIONS anyway)
diff --git a/common.rc b/common.rc
index 9c375dc..a6526a3 100644
@@ -297,6 +297,29 @@ _scratch_mkfs()
+# Create fs of certain size on scratch device
+# _scratch_mkfs_sized <size in bytes> [optional blocksize]
+ [ -z "$blocksize" ] && blocksize=4096
+ let blocks=$fssize/$blocksize
+ case $FSTYP in
+ MKFS_OPTIONS="-d size=$fssize -b size=$blocksize"
+ MKFS_OPTIONS="-b $blocksize $SCRATCH_DEV $blocks"
+ _notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized"
# Emulate an N-data-disk stripe w/ various stripe units
# _scratch_mkfs_geom <sunit bytes> <swidth multiplier> [optional blocksize]