common/dmlogwrites: genericize log writes target device

The dm-log-writes infrastructure is currently implemented to use
SCRATCH_DEV as a hardcoded data device. In preparation to allow use
of specialized devices in certain circumstances, genericize the code
to allow an arbitrary data device. This requires passing the target
device as a parameter to several helper functions from various
tests. No functional changes.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Brian Foster
2019-02-28 09:41:27 -05:00
committed by Eryu Guan
parent 19e8b1f1a9
commit de928c8e88
5 changed files with 30 additions and 18 deletions
+4 -4
View File
@@ -42,7 +42,7 @@ check_files()
local filename=$(basename $i)
local mark="${filename##*.}"
echo "checking $filename" >> $seqres.full
_log_writes_replay_log $filename
_log_writes_replay_log $filename $SCRATCH_DEV
_scratch_mount
local expected_md5=$(_md5_checksum $i)
local md5=$(_md5_checksum $SCRATCH_MNT/$name)
@@ -57,7 +57,7 @@ rm -rf $SANITY_DIR
mkdir $SANITY_DIR
# Create the log
_log_writes_init
_log_writes_init $SCRATCH_DEV
_log_writes_mkfs >> $seqres.full 2>&1
@@ -92,7 +92,7 @@ _check_scratch_fs
# check pre umount
echo "checking pre umount" >> $seqres.full
_log_writes_replay_log last
_log_writes_replay_log last $SCRATCH_DEV
_scratch_mount
_scratch_unmount
_check_scratch_fs
@@ -103,7 +103,7 @@ done
# Check the end
echo "checking post umount" >> $seqres.full
_log_writes_replay_log end
_log_writes_replay_log end $SCRATCH_DEV
_scratch_mount
for j in `seq 0 $((NUM_FILES-1))`; do
md5=$(_md5_checksum $SCRATCH_MNT/testfile$j)