overlay: create helper _overlay_scratch_mount_dirs()

A helper to mount with same options/mnt/dev of scratch mount, but
optionally with different lower/upper/work dirs.
use instead of _overlay_mount_dirs() in all tests where applicable.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Amir Goldstein
2017-09-27 10:04:11 +03:00
committed by Eryu Guan
parent 510ea29201
commit 371f7f52f2
8 changed files with 31 additions and 26 deletions
+13
View File
@@ -345,6 +345,19 @@ _overlay_mount_dirs()
-o workdir=$workdir `_common_dev_mount_options $*`
}
# Mount with same options/mnt/dev of scratch mount, but optionally
# with different lower/upper/work dirs
_overlay_scratch_mount_dirs()
{
local lowerdir=$1
local upperdir=$2
local workdir=$3
shift 3
_overlay_mount_dirs $lowerdir $upperdir $workdir \
$* $OVL_BASE_SCRATCH_MNT $SCRATCH_MNT
}
_overlay_mkdirs()
{
local dir=$1