mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
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:
committed by
Eryu Guan
parent
3ea91b080b
commit
fff869cb9c
+1
-1
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
Reference in New Issue
Block a user