common: use mount/umount helpers everywhere

Replace every explicit mount/umount of scratch or test devices with
helper functions. This allows the next patch to add in hooks to these
functions in order to set up & tear down overlayfs on every mount/umount

(also adds _test_unmount(), which didn't exist prior)

[Eryu Guan rebased the patch agains latest master and replaced more
mount/umount with helpers]

Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Eric Sandeen
2015-12-21 18:07:43 +11:00
committed by Dave Chinner
parent 4545386ca0
commit 27d077ec0b
136 changed files with 293 additions and 288 deletions
+5 -5
View File
@@ -439,7 +439,7 @@ for section in $HOST_OPTIONS_SECTIONS; do
if $RECREATE_TEST_DEV || [ "$OLD_FSTYP" != "$FSTYP" ]; then
echo "RECREATING -- $FSTYP on $TEST_DEV"
umount $TEST_DEV 2> /dev/null
_test_unmount 2> /dev/null
if ! _test_mkfs >$tmp.err 2>&1
then
echo "our local _test_mkfs routine ..."
@@ -456,7 +456,7 @@ for section in $HOST_OPTIONS_SECTIONS; do
fi
_prepare_test_list
elif [ "$OLD_MOUNT_OPTIONS" != "$MOUNT_OPTIONS" ]; then
umount $TEST_DEV 2> /dev/null
_test_unmount 2> /dev/null
out=`_mount_or_remount_rw "$MOUNT_OPTIONS" $TEST_DEV $TEST_DIR`
if [ $? -ne 1 ]; then
echo $out
@@ -486,7 +486,7 @@ for section in $HOST_OPTIONS_SECTIONS; do
needwrap=true
if [ ! -z "$SCRATCH_DEV" ]; then
umount $SCRATCH_DEV 2>/dev/null
_scratch_unmount 2> /dev/null
# call the overridden mkfs - make sure the FS is built
# the same as we'll create it later.
@@ -679,8 +679,8 @@ for section in $HOST_OPTIONS_SECTIONS; do
_wrapup
echo
umount $TEST_DEV 2> /dev/null
umount $SCRATCH_DEV 2> /dev/null
_test_unmount 2> /dev/null
_scratch_unmount 2> /dev/null
done
interrupt=false