From c2cda723f6660f6f6c0426ff7b3e16429c3af0ae Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Tue, 19 Mar 2019 17:45:35 -0700 Subject: [PATCH] common/populate: support multiple cached images Enhance the populated fs metadump image cache to support multiple configurations per filesystem so that we reduce the image creation overhead even further. Signed-off-by: Darrick J. Wong Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- common/populate | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/populate b/common/populate index 1f921ac5..4fa118f0 100644 --- a/common/populate +++ b/common/populate @@ -805,10 +805,12 @@ _scratch_populate_restore_cached() { # Populate a scratch FS from scratch or from a cached image. _scratch_populate_cached() { local meta_descr="$(_scratch_populate_cache_tag "$@")" + local meta_tag="$(echo "${meta_descr}" | md5sum - | cut -d ' ' -f 1)" + local metadump_stem="${TEST_DIR}/__populate.${FSTYP}.${meta_tag}" # These variables are shared outside this function - POPULATE_METADUMP="${TEST_DIR}/__populate.${FSTYP}" - POPULATE_METADUMP_DESCR="${TEST_DIR}/__populate.${FSTYP}.txt" + POPULATE_METADUMP="${metadump_stem}.metadump" + POPULATE_METADUMP_DESCR="${metadump_stem}.txt" # Don't keep metadata images cached for more 48 hours... rm -rf "$(find "${POPULATE_METADUMP}" -mtime +2 2>/dev/null)" -- 2.30.2