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
+7 -7
View File
@@ -78,25 +78,25 @@ quotacheck -u -g $SCRATCH_MNT 2>/dev/null
quotaon -u -g $SCRATCH_MNT 2>/dev/null
if ! _fsx 1; then
umount $SCRATCH_DEV 2>/dev/null
_scratch_unmount 2>/dev/null
status=1
exit
fi
if ! _check_quota_usage; then
umount $SCRATCH_DEV 2>/dev/null
_scratch_unmount 2>/dev/null
status=1
exit
fi
if ! _fsx 4; then
umount $SCRATCH_DEV 2>/dev/null
_scratch_unmount 2>/dev/null
status=1
exit
fi
if ! _check_quota_usage; then
umount $SCRATCH_DEV 2>/dev/null
_scratch_unmount 2>/dev/null
status=1
exit
fi
@@ -104,17 +104,17 @@ fi
#flush cache after write
FSX_ARGS="-f $FSX_ARGS"
if ! _fsx 1; then
umount $SCRATCH_DEV 2>/dev/null
_scratch_unmount 2>/dev/null
status=1
exit
fi
if ! _check_quota_usage; then
umount $SCRATCH_DEV 2>/dev/null
_scratch_unmount 2>/dev/null
status=1
exit
fi
umount $SCRATCH_DEV 2>/dev/null
_scratch_unmount 2>/dev/null
status=0
exit