xfs/419: remove irrelevant swapfile test
[xfstests-dev.git] / common / dmhugedisk
index 733b10cd22923c5b60e54e6deb83b081dc4e4135..502f0243772d52d801e77e95ee64a87edda18098 100644 (file)
@@ -1,25 +1,8 @@
 ##/bin/bash
-# Routines for creating huge (fake) disks
-#-----------------------------------------------------------------------
-#  Copyright (c) 2016 Oracle.  All Rights Reserved.
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
+# SPDX-License-Identifier: GPL-2.0+
+# Copyright (c) 2016 Oracle.  All Rights Reserved.
 #
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
-#  USA
-#
-#  Contact information: Oracle Corporation, 500 Oracle Parkway,
-#  Redwood Shores, CA 94065, USA, or: http://www.oracle.com/
-#-----------------------------------------------------------------------
+# Routines for creating huge (fake) disks
 
 _require_dmhugedisk()
 {
@@ -37,8 +20,8 @@ _dmhugedisk_init()
                chunk_size=512
        fi
 
-       $DMSETUP_PROG remove huge-test > /dev/null 2>&1
-       $DMSETUP_PROG remove huge-test-zero > /dev/null 2>&1
+       _dmsetup_remove huge-test
+       _dmsetup_remove huge-test-zero
 
        local blk_dev_size=$1
 
@@ -48,18 +31,15 @@ _dmhugedisk_init()
        DMHUGEDISK_ZERO_TABLE="0 $blk_dev_size zero"
        DMHUGEDISK_DEV_TABLE="0 $blk_dev_size snapshot $DMHUGEDISK_ZERO $SCRATCH_DEV N $chunk_size"
 
-       $DMSETUP_PROG create huge-test-zero --table "$DMHUGEDISK_ZERO_TABLE" || \
+       _dmsetup_create huge-test-zero --table "$DMHUGEDISK_ZERO_TABLE" || \
                _fatal "failed to create dm huge zero device"
-       $DMSETUP_PROG create huge-test --table "$DMHUGEDISK_DEV_TABLE" || \
+       _dmsetup_create huge-test --table "$DMHUGEDISK_DEV_TABLE" || \
                _fatal "failed to create dm huge device"
 }
 
 _dmhugedisk_cleanup()
 {
        $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
-       # wait for device to be fully settled so that 'dmsetup remove' doesn't
-       # fail due to EBUSY
-       $UDEV_SETTLE_PROG >/dev/null 2>&1
-       $DMSETUP_PROG remove huge-test > /dev/null 2>&1
-       $DMSETUP_PROG remove huge-test-zero > /dev/null 2>&1
+       _dmsetup_remove huge-test
+       _dmsetup_remove huge-test-zero
 }