mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfstests: Add new standard loop handling functions
Add _create_loop_device and _destroy_loop_device to uniformly handle loopback devices. V1->V2: Fix possible race Signed-off-by: Tomas Racek <tracek@redhat.com> Reviewed-by: Rich Johnston <rjohnston@sgi.com> Signed-off-by: Rich Johnston <rjohnston@sgi.com>
This commit is contained in:
committed by
Rich Johnston
parent
03b0089e9b
commit
29fe8007e7
@@ -1833,6 +1833,19 @@ _require_dumpe2fs()
|
||||
fi
|
||||
}
|
||||
|
||||
_create_loop_device()
|
||||
{
|
||||
file=$1
|
||||
dev=`losetup -f --show $file` || _fail "Cannot assign $file to a loop device"
|
||||
echo $dev
|
||||
}
|
||||
|
||||
_destroy_loop_device()
|
||||
{
|
||||
dev=$1
|
||||
losetup -d $dev || _fail "Cannot destroy loop device $dev"
|
||||
}
|
||||
|
||||
################################################################################
|
||||
|
||||
if [ "$iam" != new -a "$iam" != bench ]
|
||||
|
||||
Reference in New Issue
Block a user