populate: cache scratch metadata images

Create a helper function to create a populated FS image and dump the
metadata into a file on the test device, with the purpose of allowing
future (fuzzer) invocations of _populate_fs use the cached metadata to
save time.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Darrick J. Wong
2017-01-21 00:10:58 -08:00
committed by Eryu Guan
parent dac5feaea7
commit d6445ed41a
2 changed files with 46 additions and 1 deletions
+2 -1
View File
@@ -471,12 +471,13 @@ _scratch_do_mkfs()
_scratch_metadump()
{
dumpfile=$1
shift
options=
[ "$USE_EXTERNAL" = yes -a ! -z "$SCRATCH_LOGDEV" ] && \
options="-l $SCRATCH_LOGDEV"
xfs_metadump $options $SCRATCH_DEV $dumpfile
xfs_metadump $options "$@" $SCRATCH_DEV $dumpfile
}
_setup_large_ext4_fs()