xfs: filestream allocator inode use-after-free test
[xfstests-dev.git] / common / rc
index 0c3359fd5539804b5f4b1c80dcdc7e4a6eb3c634..9ffab7fd0907d1a7132f6d65abbd3df4cb527fd4 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1600,6 +1600,16 @@ _require_scratch()
        touch ${RESULT_DIR}/require_scratch
 }
 
        touch ${RESULT_DIR}/require_scratch
 }
 
+# require a scratch dev of a minimum size (in kb)
+_require_scratch_size()
+{
+       [ $# -eq 1 ] || _fail "_require_scratch_size: expected size param"
+
+       _require_scratch
+       local devsize=`_get_device_size $SCRATCH_DEV`
+       [ $devsize -lt $1 ] && _notrun "scratch dev too small"
+}
+
 
 # this test needs a test partition - check we're ok & mount it
 #
 
 # this test needs a test partition - check we're ok & mount it
 #