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
+3 -3
View File
@@ -29,7 +29,7 @@ status=1 # failure is the default!
_cleanup()
{
echo " *** umount"
umount $SCRATCH_DEV >/dev/null 2>&1
_scratch_unmount >/dev/null 2>&1
}
trap "_cleanup; exit \$status" 0 1 2 3 15
@@ -85,7 +85,7 @@ _log "*** (`date`)"
_log " *** init"
_log " *** unmounting scratch device"
umount $SCRATCH_DEV 2>&1 | _fix_malloc >>$FULL
_scratch_unmount 2>&1 | _fix_malloc >>$FULL
_log " *** clean scratch device"
@@ -128,7 +128,7 @@ do
_log " *** unmounting scratch device"
umount $SCRATCH_DEV 2>&1 | _logp \
_scratch_unmount 2>&1 | _logp \
|| _fail " !!! failed to umount"
let "pass = pass + 1"