diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2016-09-29 19:23:34 -0700 |
---|---|---|
committer | Eryu Guan <eguan@redhat.com> | 2016-10-07 17:18:53 +0800 |
commit | fff869cb9c49a15b34dcec5ccf620f026752cf05 (patch) | |
tree | f33fcb923d4c158122d2c1b540f387903aa7eccb | |
parent | 3ea91b080b42eab74a636bd4c2c15946715bcd5e (diff) | |
download | xfstests-dev-fff869cb9c49a15b34dcec5ccf620f026752cf05.tar.gz |
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>
69 files changed, 70 insertions, 70 deletions
diff --git a/tests/generic/150 b/tests/generic/150 index 2e21d37ed0..fadbb424bf 100755 --- a/tests/generic/150 +++ b/tests/generic/150 @@ -55,7 +55,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='15%' sz=$((blksz * blks)) diff --git a/tests/generic/151 b/tests/generic/151 index 55e0e02766..b0f0521867 100755 --- a/tests/generic/151 +++ b/tests/generic/151 @@ -59,7 +59,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='15%' sz=$((blksz * blks)) diff --git a/tests/generic/152 b/tests/generic/152 index 9fe4d32c68..aa10bcfa29 100755 --- a/tests/generic/152 +++ b/tests/generic/152 @@ -60,7 +60,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='15%' sz=$((blksz * blks)) diff --git a/tests/generic/153 b/tests/generic/153 index 5d22153a5e..2ddb48d7bf 100755 --- a/tests/generic/153 +++ b/tests/generic/153 @@ -60,7 +60,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='15%' sz=$((blksz * blks)) diff --git a/tests/generic/154 b/tests/generic/154 index 23b626b468..f270ccb423 100755 --- a/tests/generic/154 +++ b/tests/generic/154 @@ -59,7 +59,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='15%' free_blocks0=$(stat -f $testdir -c '%f') diff --git a/tests/generic/155 b/tests/generic/155 index 50083e734a..23057c0862 100755 --- a/tests/generic/155 +++ b/tests/generic/155 @@ -64,7 +64,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='15%' sz=$((blksz * blks)) diff --git a/tests/generic/156 b/tests/generic/156 index 52ac11fea7..9e22a02442 100755 --- a/tests/generic/156 +++ b/tests/generic/156 @@ -71,7 +71,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='15%' sz=$((blksz * blks)) diff --git a/tests/generic/157 b/tests/generic/157 index fe294c88f2..9284c55c70 100755 --- a/tests/generic/157 +++ b/tests/generic/157 @@ -60,7 +60,7 @@ testdir2=$SCRATCH_MNT/test-$seq mkdir $testdir2 echo "Create the original files" -blksz="$(stat -f $testdir1 -c '%S')" +blksz="$(get_block_size $testdir1)" blks=1000 margin='7%' sz=$((blksz * blks)) diff --git a/tests/generic/158 b/tests/generic/158 index dd645627f4..086c522980 100755 --- a/tests/generic/158 +++ b/tests/generic/158 @@ -60,7 +60,7 @@ testdir2=$SCRATCH_MNT/test-$seq mkdir $testdir2 echo "Create the original files" -blksz="$(stat -f $testdir1 -c '%S')" +blksz="$(get_block_size $testdir1)" blks=1000 margin='7%' sz=$((blksz * blks)) diff --git a/tests/generic/159 b/tests/generic/159 index 5e1a899ffd..6f75b73ec0 100755 --- a/tests/generic/159 +++ b/tests/generic/159 @@ -54,7 +54,7 @@ rm -rf $testdir1 mkdir $testdir1 echo "Create the original files" -blksz="$(stat -f $testdir1 -c '%S')" +blksz="$(get_block_size $testdir1)" blks=1000 margin='7%' sz=$((blksz * blks)) diff --git a/tests/generic/160 b/tests/generic/160 index 1dc5b723c7..066bf5eac1 100755 --- a/tests/generic/160 +++ b/tests/generic/160 @@ -54,7 +54,7 @@ rm -rf $testdir1 mkdir $testdir1 echo "Create the original files" -blksz="$(stat -f $testdir1 -c '%S')" +blksz="$(get_block_size $testdir1)" blks=1000 margin='7%' sz=$((blksz * blks)) diff --git a/tests/generic/171 b/tests/generic/171 index f391685eb5..a69f798c3e 100755 --- a/tests/generic/171 +++ b/tests/generic/171 @@ -57,7 +57,7 @@ testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Reformat with appropriate size" -blksz="$(stat -f $testdir -c '%S')" +blksz="$(get_block_size $testdir)" nr_blks=10240 umount $SCRATCH_MNT sz_bytes=$((nr_blks * 8 * blksz)) diff --git a/tests/generic/173 b/tests/generic/173 index c5fac9e7a0..e35597f5e7 100755 --- a/tests/generic/173 +++ b/tests/generic/173 @@ -57,7 +57,7 @@ testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Reformat with appropriate size" -blksz="$(stat -f $testdir -c '%S')" +blksz="$(get_block_size $testdir)" nr_blks=10240 umount $SCRATCH_MNT sz_bytes=$((nr_blks * 8 * blksz)) diff --git a/tests/generic/174 b/tests/generic/174 index 8077d762b3..e58d64be84 100755 --- a/tests/generic/174 +++ b/tests/generic/174 @@ -58,7 +58,7 @@ testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Reformat with appropriate size" -blksz="$(stat -f $testdir -c '%S')" +blksz="$(get_block_size $testdir)" nr_blks=10240 umount $SCRATCH_MNT sz_bytes=$((nr_blks * 8 * blksz)) diff --git a/tests/generic/175 b/tests/generic/175 index 964580c2a3..f4f19f8475 100755 --- a/tests/generic/175 +++ b/tests/generic/175 @@ -56,7 +56,7 @@ testdir="$SCRATCH_MNT/test-$seq" mkdir "$testdir" echo "Create a one block file" -blksz="$(stat -f "$testdir" -c '%S')" +blksz="$(get_block_size $testdir)" _pwrite_byte 0x61 0 $blksz "$testdir/file1" >> "$seqres.full" fnr=19 diff --git a/tests/generic/176 b/tests/generic/176 index f7d64957ab..b14255b63f 100755 --- a/tests/generic/176 +++ b/tests/generic/176 @@ -60,7 +60,7 @@ mkdir "$testdir" # 2^17 blocks... that should be plenty for anyone. fnr=20 free_blocks=$(stat -f -c '%a' "$testdir") -blksz=$(stat -f -c '%S' "$testdir") +blksz=$(get_block_size "$testdir") space_avail=$((free_blocks * blksz)) calc_space() { blocks_needed=$(( 2 ** (fnr + 1) )) diff --git a/tests/generic/205 b/tests/generic/205 index 65c35638de..cfda8c37fc 100755 --- a/tests/generic/205 +++ b/tests/generic/205 @@ -60,7 +60,7 @@ _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq mkdir $testdir -real_blksz=$(stat -f -c '%S' $testdir) +real_blksz=$(get_block_size $testdir) test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" diff --git a/tests/generic/206 b/tests/generic/206 index 0d8006fa5c..909956fe1d 100755 --- a/tests/generic/206 +++ b/tests/generic/206 @@ -61,7 +61,7 @@ _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq mkdir $testdir -real_blksz=$(stat -f -c '%S' $testdir) +real_blksz=$(get_block_size $testdir) test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" diff --git a/tests/generic/216 b/tests/generic/216 index 29fa6a001c..d9b868a0fa 100755 --- a/tests/generic/216 +++ b/tests/generic/216 @@ -61,7 +61,7 @@ _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq mkdir $testdir -real_blksz=$(stat -f -c '%S' $testdir) +real_blksz=$(get_block_size $testdir) test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" diff --git a/tests/generic/217 b/tests/generic/217 index 3843a8bd2f..65113d9aca 100755 --- a/tests/generic/217 +++ b/tests/generic/217 @@ -62,7 +62,7 @@ _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq mkdir $testdir -real_blksz=$(stat -f -c '%S' $testdir) +real_blksz=$(get_block_size $testdir) test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" diff --git a/tests/generic/218 b/tests/generic/218 index 6e7f465f68..21029efb49 100755 --- a/tests/generic/218 +++ b/tests/generic/218 @@ -61,7 +61,7 @@ _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq mkdir $testdir -real_blksz=$(stat -f -c '%S' $testdir) +real_blksz=$(get_block_size $testdir) test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" diff --git a/tests/generic/220 b/tests/generic/220 index d3ee888412..c54bf06d3d 100755 --- a/tests/generic/220 +++ b/tests/generic/220 @@ -62,7 +62,7 @@ _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq mkdir $testdir -real_blksz=$(stat -f -c '%S' $testdir) +real_blksz=$(get_block_size $testdir) test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" diff --git a/tests/generic/222 b/tests/generic/222 index 7de8ad66ab..d7ee57ea30 100755 --- a/tests/generic/222 +++ b/tests/generic/222 @@ -61,7 +61,7 @@ _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq mkdir $testdir -real_blksz=$(stat -f -c '%S' $testdir) +real_blksz=$(get_block_size $testdir) test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" diff --git a/tests/generic/227 b/tests/generic/227 index daac550932..fa6a33ed2e 100755 --- a/tests/generic/227 +++ b/tests/generic/227 @@ -62,7 +62,7 @@ _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq mkdir $testdir -real_blksz=$(stat -f -c '%S' $testdir) +real_blksz=$(get_block_size $testdir) test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." echo "Create the original files" diff --git a/tests/generic/229 b/tests/generic/229 index a307408b6e..3e2c6f4c84 100755 --- a/tests/generic/229 +++ b/tests/generic/229 @@ -61,7 +61,7 @@ _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq mkdir $testdir -real_blksz=$(stat -f -c '%S' $testdir) +real_blksz=$(get_block_size $testdir) test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." runtest() { diff --git a/tests/generic/238 b/tests/generic/238 index 38e3aaced8..a2f44e8f61 100755 --- a/tests/generic/238 +++ b/tests/generic/238 @@ -62,7 +62,7 @@ _scratch_mount >> $seqres.full 2>&1 testdir=$SCRATCH_MNT/test-$seq mkdir $testdir -real_blksz=$(stat -f -c '%S' $testdir) +real_blksz=$(get_block_size $testdir) test $real_blksz != $blksz && _notrun "Failed to format with small blocksize." runtest() { diff --git a/tests/generic/242 b/tests/generic/242 index 93fdc1dba4..2b07067366 100755 --- a/tests/generic/242 +++ b/tests/generic/242 @@ -65,7 +65,7 @@ bufnr=1280 bufsize=$((blksz * bufnr)) free_blocks=$(stat -f -c '%a' $testdir) -real_blksz=$(stat -f -c '%S' $testdir) +real_blksz=$(get_block_size $testdir) space_needed=$(((filesize * 3) * 5 / 4)) space_avail=$((free_blocks * real_blksz)) test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" diff --git a/tests/generic/243 b/tests/generic/243 index ae9caa2de9..1ba3e8ac09 100755 --- a/tests/generic/243 +++ b/tests/generic/243 @@ -66,7 +66,7 @@ bufnr=1280 bufsize=$((blksz * bufnr)) free_blocks=$(stat -f -c '%a' $testdir) -real_blksz=$(stat -f -c '%S' $testdir) +real_blksz=$(get_block_size $testdir) space_needed=$(((filesize * 3) * 5 / 4)) space_avail=$((free_blocks * real_blksz)) test $space_needed -gt $space_avail && _notrun "Not enough space. $space_avail < $space_needed" diff --git a/tests/generic/296 b/tests/generic/296 index 42970887b4..919900656c 100755 --- a/tests/generic/296 +++ b/tests/generic/296 @@ -61,7 +61,7 @@ filesize=$((blksz * nr)) bufnr=16 bufsize=$((blksz * bufnr)) -real_blksz=$(stat -f -c '%S' "$testdir") +real_blksz=$(get_block_size "$testdir") _require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) echo "Create the original files" diff --git a/tests/generic/297 b/tests/generic/297 index 4ae2b9c634..8dfc34242b 100755 --- a/tests/generic/297 +++ b/tests/generic/297 @@ -59,7 +59,7 @@ testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create a one block file" -blksz="$(stat -f $testdir -c '%S')" +blksz="$(get_block_size $testdir)" _pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full fnr=26 # 2^26 reflink extents should be enough to find a slow op? diff --git a/tests/generic/298 b/tests/generic/298 index e85db1266f..3f6446c18e 100755 --- a/tests/generic/298 +++ b/tests/generic/298 @@ -59,7 +59,7 @@ testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create a one block file" -blksz="$(stat -f $testdir -c '%S')" +blksz="$(get_block_size $testdir)" _pwrite_byte 0x61 0 $blksz $testdir/file1 >> $seqres.full fnr=26 # 2^26 reflink extents should be enough to find a slow op? diff --git a/tests/generic/301 b/tests/generic/301 index a513333a84..a196cd416a 100755 --- a/tests/generic/301 +++ b/tests/generic/301 @@ -65,7 +65,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" diff --git a/tests/generic/302 b/tests/generic/302 index 1600b5aec7..b2298cb31a 100755 --- a/tests/generic/302 +++ b/tests/generic/302 @@ -66,7 +66,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" diff --git a/tests/xfs/127 b/tests/xfs/127 index 6b768c934b..8212ec3911 100755 --- a/tests/xfs/127 +++ b/tests/xfs/127 @@ -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 diff --git a/tests/xfs/128 b/tests/xfs/128 index 04633a1090..6bb6282f0b 100755 --- a/tests/xfs/128 +++ b/tests/xfs/128 @@ -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 diff --git a/tests/xfs/129 b/tests/xfs/129 index 17ff238884..10880e52aa 100755 --- a/tests/xfs/129 +++ b/tests/xfs/129 @@ -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 diff --git a/tests/xfs/132 b/tests/xfs/132 index b09ccb6595..7f7ebaa353 100755 --- a/tests/xfs/132 +++ b/tests/xfs/132 @@ -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)) diff --git a/tests/xfs/139 b/tests/xfs/139 index 16193e5162..b62ef1b58e 100755 --- a/tests/xfs/139 +++ b/tests/xfs/139 @@ -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)) diff --git a/tests/xfs/140 b/tests/xfs/140 index 052c5394fc..a87357b0ec 100755 --- a/tests/xfs/140 +++ b/tests/xfs/140 @@ -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)) diff --git a/tests/xfs/169 b/tests/xfs/169 index 996500e12a..acd4b89613 100755 --- a/tests/xfs/169 +++ b/tests/xfs/169 @@ -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 diff --git a/tests/xfs/180 b/tests/xfs/180 index 00e91a4142..e2d336993c 100755 --- a/tests/xfs/180 +++ b/tests/xfs/180 @@ -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" diff --git a/tests/xfs/182 b/tests/xfs/182 index b7aa5e7029..2545f00362 100755 --- a/tests/xfs/182 +++ b/tests/xfs/182 @@ -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" diff --git a/tests/xfs/184 b/tests/xfs/184 index 6d32e93a14..e843b4eb5f 100755 --- a/tests/xfs/184 +++ b/tests/xfs/184 @@ -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" diff --git a/tests/xfs/192 b/tests/xfs/192 index 8594787cf0..01f5e1c97c 100755 --- a/tests/xfs/192 +++ b/tests/xfs/192 @@ -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" diff --git a/tests/xfs/193 b/tests/xfs/193 index f59b3bd03f..2cd8880947 100755 --- a/tests/xfs/193 +++ b/tests/xfs/193 @@ -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" diff --git a/tests/xfs/198 b/tests/xfs/198 index c12d915b1b..f55ed23689 100755 --- a/tests/xfs/198 +++ b/tests/xfs/198 @@ -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" diff --git a/tests/xfs/200 b/tests/xfs/200 index a750ef64f0..ebb6e736a8 100755 --- a/tests/xfs/200 +++ b/tests/xfs/200 @@ -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" diff --git a/tests/xfs/204 b/tests/xfs/204 index ae21d6ee46..6e5b896f63 100755 --- a/tests/xfs/204 +++ b/tests/xfs/204 @@ -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" diff --git a/tests/xfs/208 b/tests/xfs/208 index 4f56884d17..e64106a9b9 100755 --- a/tests/xfs/208 +++ b/tests/xfs/208 @@ -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" diff --git a/tests/xfs/211 b/tests/xfs/211 index 9f01d08449..68abaf7e39 100755 --- a/tests/xfs/211 +++ b/tests/xfs/211 @@ -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" diff --git a/tests/xfs/215 b/tests/xfs/215 index b9c9ab44d7..c4bb32204b 100755 --- a/tests/xfs/215 +++ b/tests/xfs/215 @@ -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 diff --git a/tests/xfs/218 b/tests/xfs/218 index 887a13598e..7fcca82e3d 100755 --- a/tests/xfs/218 +++ b/tests/xfs/218 @@ -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 diff --git a/tests/xfs/219 b/tests/xfs/219 index 5ae0714c76..f02cc2d259 100755 --- a/tests/xfs/219 +++ b/tests/xfs/219 @@ -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 diff --git a/tests/xfs/221 b/tests/xfs/221 index 3afc75f203..1dfcd9698c 100755 --- a/tests/xfs/221 +++ b/tests/xfs/221 @@ -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_holes $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full diff --git a/tests/xfs/223 b/tests/xfs/223 index 3f34bcfa03..d93b31121c 100755 --- a/tests/xfs/223 +++ b/tests/xfs/223 @@ -67,7 +67,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 diff --git a/tests/xfs/224 b/tests/xfs/224 index 91033fa9dc..7a59dbacaf 100755 --- a/tests/xfs/224 +++ b/tests/xfs/224 @@ -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 diff --git a/tests/xfs/225 b/tests/xfs/225 index 2260441913..596cdb86f0 100755 --- a/tests/xfs/225 +++ b/tests/xfs/225 @@ -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_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full diff --git a/tests/xfs/226 b/tests/xfs/226 index ac702396a1..d3a0dc0b4a 100755 --- a/tests/xfs/226 +++ b/tests/xfs/226 @@ -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_regular $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full diff --git a/tests/xfs/228 b/tests/xfs/228 index 65d7f5133d..994f501461 100755 --- a/tests/xfs/228 +++ b/tests/xfs/228 @@ -72,7 +72,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_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full diff --git a/tests/xfs/230 b/tests/xfs/230 index 73c6267451..f4b9f157b1 100755 --- a/tests/xfs/230 +++ b/tests/xfs/230 @@ -72,7 +72,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_rainbow $blksz $nr $testdir/file1 $testdir/file3 >> $seqres.full diff --git a/tests/xfs/231 b/tests/xfs/231 index d89139a9de..54fc46da14 100755 --- a/tests/xfs/231 +++ b/tests/xfs/231 @@ -72,7 +72,7 @@ bufnr=2 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" diff --git a/tests/xfs/232 b/tests/xfs/232 index 2438f1fdf0..0ffa19897f 100755 --- a/tests/xfs/232 +++ b/tests/xfs/232 @@ -73,7 +73,7 @@ bufnr=2 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" diff --git a/tests/xfs/233 b/tests/xfs/233 index 8fcf766c07..a0c1612995 100755 --- a/tests/xfs/233 +++ b/tests/xfs/233 @@ -53,7 +53,7 @@ testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original files" -blksz="$(stat -f $testdir -c '%S')" +blksz="$(get_block_size $testdir)" _pwrite_byte 0x61 0 $((blksz * 14 + 71)) $testdir/original >> $seqres.full cp -p $testdir/original $testdir/copy1 cp -p $testdir/copy1 $testdir/copy2 diff --git a/tests/xfs/234 b/tests/xfs/234 index 8dadc34158..9a60ec6f34 100755 --- a/tests/xfs/234 +++ b/tests/xfs/234 @@ -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 sync diff --git a/tests/xfs/236 b/tests/xfs/236 index c7b3a19849..e5840cbd8a 100755 --- a/tests/xfs/236 +++ b/tests/xfs/236 @@ -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 diff --git a/tests/xfs/265 b/tests/xfs/265 index 2039d9cd9a..c8fb527c4d 100755 --- a/tests/xfs/265 +++ b/tests/xfs/265 @@ -59,7 +59,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=$((2 * blksz / 12)) for i in 1 2 x; do diff --git a/tests/xfs/309 b/tests/xfs/309 index 3578690e41..38c04528b0 100755 --- a/tests/xfs/309 +++ b/tests/xfs/309 @@ -59,7 +59,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=$((2 * blksz / 12)) for i in 1 2 x; do diff --git a/tests/xfs/310 b/tests/xfs/310 index 5125773e95..cce21be0a0 100755 --- a/tests/xfs/310 +++ b/tests/xfs/310 @@ -58,7 +58,7 @@ _scratch_mkfs >/dev/null 2>&1 _scratch_mount >> $seqres.full testdir=$SCRATCH_MNT/test-$seq -blksz="$(stat -f $SCRATCH_MNT -c '%S')" +blksz="$(get_block_size $SCRATCH_MNT)" umount $SCRATCH_MNT @@ -72,7 +72,7 @@ xfs_info $SCRATCH_MNT >> $seqres.full echo "Create the original file blocks" mkdir $testdir -blksz="$(stat -f $testdir -c '%S')" +blksz="$(get_block_size $testdir)" $XFS_IO_PROG -f -c "falloc 0 $((nr_blks * blksz))" $testdir/file1 >> $seqres.full echo "Check extent count" diff --git a/tests/xfs/328 b/tests/xfs/328 index 342fad5032..33a0befe54 100755 --- a/tests/xfs/328 +++ b/tests/xfs/328 @@ -62,7 +62,7 @@ mkdir "$testdir" # 2^10 blocks... that should be plenty for anyone. fnr=$((12 + LOAD_FACTOR)) free_blocks=$(stat -f -c '%a' "$testdir") -blksz=$(stat -f -c '%S' "$testdir") +blksz=$(get_block_size $testdir) space_avail=$((free_blocks * blksz)) calc_space() { |