fstests: use get_block_size helper

Don't open code grabbing the block size; just use the helper.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Darrick J. Wong
2016-09-29 19:23:34 -07:00
committed by Eryu Guan
parent 3ea91b080b
commit fff869cb9c
69 changed files with 70 additions and 70 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original file and reflink to copy1, copy2"
blksz="$(stat -f $testdir -c '%S')"
blksz="$(get_block_size $testdir)"
_pwrite_byte 0x61 0 $((blksz * 14 + 71)) $testdir/original >> $seqres.full
_cp_reflink $testdir/original $testdir/copy1
_cp_reflink $testdir/copy1 $testdir/copy2
+1 -1
View File
@@ -60,7 +60,7 @@ echo "Create the original file and reflink to file2, file3"
blks=2000
margin=160
blksz=65536
real_blksz="$(stat -f $testdir -c '%S')"
real_blksz="$(get_block_size $testdir)"
blksz_factor=$((blksz / real_blksz))
_pwrite_byte 0x61 0 $((blks * blksz)) $testdir/file1 >> $seqres.full
_cp_reflink $testdir/file1 $testdir/file2
+1 -1
View File
@@ -59,7 +59,7 @@ mkdir $testdir
metadump_file=$TEST_DIR/${seq}_metadump
echo "Create the original file blocks"
blksz="$(stat -f $testdir -c '%S')"
blksz="$(get_block_size $testdir)"
nr_blks=$((4 * blksz / 12))
_pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/file1 >> $seqres.full
+1 -1
View File
@@ -72,7 +72,7 @@ rm -rf $testdir
mkdir $testdir
echo "Create the original file blocks"
blksz="$(stat -f $testdir -c '%S')"
blksz="$(get_block_size $testdir)"
blks=2000
margin=100
sz=$((blksz * blks))
+1 -1
View File
@@ -54,7 +54,7 @@ _scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
blksz="$(stat -f $testdir -c '%S')"
blksz="$(get_block_size $testdir)"
echo "Create the original files"
sz=$((48 * 1048576))
+1 -1
View File
@@ -54,7 +54,7 @@ _scratch_mount >> $seqres.full 2>&1
testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
blksz=$(stat -f -c '%S' $testdir)
blksz=$(get_block_size $testdir)
echo "Create the original files"
sz=$((48 * 1048576))
+1 -1
View File
@@ -57,7 +57,7 @@ testdir=$SCRATCH_MNT/test-$seq
mkdir $testdir
echo "Create the original file blocks"
blksz="$(stat -f $testdir -c '%S')"
blksz="$(get_block_size $testdir)"
nr_blks=$((8 * blksz / 12))
for i in 1 2 x; do
+1 -1
View File
@@ -68,7 +68,7 @@ bufnr=16
bufsize=$((blksz * bufnr))
_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4))
real_blksz=$(stat -f -c '%S' $testdir)
real_blksz=$(get_block_size $testdir)
internal_blks=$((filesize / real_blksz))
echo "Create the original files"
+1 -1
View File
@@ -69,7 +69,7 @@ bufnr=16
bufsize=$((blksz * bufnr))
_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4))
real_blksz=$(stat -f -c '%S' $testdir)
real_blksz=$(get_block_size $testdir)
internal_blks=$((filesize / real_blksz))
echo "Create the original files"
+1 -1
View File
@@ -68,7 +68,7 @@ bufnr=16
bufsize=$((blksz * bufnr))
_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4))
real_blksz=$(stat -f -c '%S' $testdir)
real_blksz=$(get_block_size $testdir)
internal_blks=$((filesize / real_blksz))
echo "Create the original files"
+1 -1
View File
@@ -69,7 +69,7 @@ bufnr=16
bufsize=$((blksz * bufnr))
_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4))
real_blksz=$(stat -f -c '%S' $testdir)
real_blksz=$(get_block_size $testdir)
internal_blks=$((filesize / real_blksz))
echo "Create the original files"
+1 -1
View File
@@ -67,7 +67,7 @@ bufnr=16
bufsize=$((blksz * bufnr))
_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4))
real_blksz=$(stat -f -c '%S' $testdir)
real_blksz=$(get_block_size $testdir)
internal_blks=$((filesize / real_blksz))
echo "Create the original files"
+1 -1
View File
@@ -68,7 +68,7 @@ bufnr=16
bufsize=$((blksz * bufnr))
_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4))
real_blksz=$(stat -f -c '%S' $testdir)
real_blksz=$(get_block_size $testdir)
internal_blks=$((filesize / real_blksz))
echo "Create the original files"
+1 -1
View File
@@ -70,7 +70,7 @@ bufnr=16
bufsize=$((blksz * bufnr))
_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4))
real_blksz=$(stat -f -c '%S' $testdir)
real_blksz=$(get_block_size $testdir)
internal_blks=$((filesize / real_blksz))
echo "Create the original files"
+1 -1
View File
@@ -71,7 +71,7 @@ bufnr=16
bufsize=$((blksz * bufnr))
_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4))
real_blksz=$(stat -f -c '%S' $testdir)
real_blksz=$(get_block_size $testdir)
internal_blks=$((filesize / real_blksz))
echo "Create the original files"
+1 -1
View File
@@ -71,7 +71,7 @@ bufnr=16
bufsize=$((blksz * bufnr))
_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4))
real_blksz=$(stat -f -c '%S' $testdir)
real_blksz=$(get_block_size $testdir)
internal_blks=$((filesize / real_blksz))
echo "Create the original files"
+1 -1
View File
@@ -69,7 +69,7 @@ bufnr=16
bufsize=$((blksz * bufnr))
_require_fs_space $SCRATCH_MNT $((filesize / 1024 * 2 * 5 / 4))
real_blksz=$(stat -f -c '%S' $testdir)
real_blksz=$(get_block_size $testdir)
internal_blks=$((filesize / real_blksz))
echo "Create the original files"
+1 -1
View File
@@ -66,7 +66,7 @@ echo "Create the original files"
blksz=65536
nr=64
filesize=$((blksz * nr))
real_blksz=$(stat -f -c '%S' $testdir)
real_blksz=$(get_block_size $testdir)
internal_blks=$((filesize / real_blksz))
$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full
_weave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
+1 -1
View File
@@ -65,7 +65,7 @@ echo "Create the original files"
blksz=65536
nr=64
filesize=$((blksz * nr))
real_blksz=$(stat -f -c '%S' $testdir)
real_blksz=$(get_block_size $testdir)
internal_blks=$((filesize / real_blksz))
$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full
_weave_reflink_unwritten $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full
+1 -1
View File
@@ -66,7 +66,7 @@ echo "Create the original files"
blksz=65536
nr=64
filesize=$((blksz * nr))
real_blksz=$(stat -f -c '%S' $testdir)
real_blksz=$(get_block_size $testdir)
internal_blks=$((filesize / real_blksz))
$XFS_IO_PROG -c "cowextsize $((blksz * 16))" $testdir >> $seqres.full
_weave_reflink_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full

Some files were not shown because too many files have changed in this diff Show More