[PATCH 1/2] common: make _dmerror_init accept device and mount point as param

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently dmerror code takes use of SCRATCH_DEV and SCRATCH_MNT as the
backend device and mount point, and there's no way to change them.

Now teach _dmerror_init to accept first argument as backend device and
second argument as the alternative mount point, this can be useful when
SCRATCH_DEV and/or SCRATCH_MNT is not suitable for the test.

Signed-off-by: Eryu Guan <eguan@xxxxxxxxxx>
---
 common/dmerror | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/common/dmerror b/common/dmerror
index 004530d..b2f1e8f 100644
--- a/common/dmerror
+++ b/common/dmerror
@@ -20,7 +20,8 @@
 
 _dmerror_init()
 {
-	local dm_backing_dev=$SCRATCH_DEV
+	local dm_backing_dev=${1:-$SCRATCH_DEV}
+	DMERROR_MNT=${2:-$SCRATCH_MNT}
 
 	$DMSETUP_PROG remove error-test > /dev/null 2>&1
 
@@ -38,7 +39,7 @@ _dmerror_init()
 
 _dmerror_mount_options()
 {
-	echo `_common_dev_mount_options $*` $DMERROR_DEV $SCRATCH_MNT
+	echo `_common_dev_mount_options $*` $DMERROR_DEV $DMERROR_MNT
 }
 
 _dmerror_mount()
@@ -48,12 +49,12 @@ _dmerror_mount()
 
 _dmerror_unmount()
 {
-	umount $SCRATCH_MNT
+	umount $DMERROR_MNT
 }
 
 _dmerror_cleanup()
 {
-	$UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
+	$UMOUNT_PROG $DMERROR_MNT > /dev/null 2>&1
 	$DMSETUP_PROG remove error-test > /dev/null 2>&1
 }
 
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux