fstests: use get_block_size helper
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 30 Sep 2016 02:23:34 +0000 (19:23 -0700)
committerEryu Guan <eguan@redhat.com>
Fri, 7 Oct 2016 09:18:53 +0000 (17:18 +0800)
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:
tests/generic/150
tests/generic/151
tests/generic/152
tests/generic/153
tests/generic/154
tests/generic/155
tests/generic/156
tests/generic/157
tests/generic/158
tests/generic/159
tests/generic/160
tests/generic/171
tests/generic/173
tests/generic/174
tests/generic/175
tests/generic/176
tests/generic/205
tests/generic/206
tests/generic/216
tests/generic/217
tests/generic/218
tests/generic/220
tests/generic/222
tests/generic/227
tests/generic/229
tests/generic/238
tests/generic/242
tests/generic/243
tests/generic/296
tests/generic/297
tests/generic/298
tests/generic/301
tests/generic/302
tests/xfs/127
tests/xfs/128
tests/xfs/129
tests/xfs/132
tests/xfs/139
tests/xfs/140
tests/xfs/169
tests/xfs/180
tests/xfs/182
tests/xfs/184
tests/xfs/192
tests/xfs/193
tests/xfs/198
tests/xfs/200
tests/xfs/204
tests/xfs/208
tests/xfs/211
tests/xfs/215
tests/xfs/218
tests/xfs/219
tests/xfs/221
tests/xfs/223
tests/xfs/224
tests/xfs/225
tests/xfs/226
tests/xfs/228
tests/xfs/230
tests/xfs/231
tests/xfs/232
tests/xfs/233
tests/xfs/234
tests/xfs/236
tests/xfs/265
tests/xfs/309
tests/xfs/310
tests/xfs/328

index 2e21d37ed0db69e48a7ffef8176e1af8b3b48c3e..fadbb424bf82bf690ac455114a15c59c95e1113e 100755 (executable)
@@ -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))
index 55e0e027667a27d4c6f1ca49f4fcbc61a434d7eb..b0f0521867373125df0b320ecf2b466fc64ea38c 100755 (executable)
@@ -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))
index 9fe4d32c683b41e3cee7b01d454313638aca931d..aa10bcfa2915c965da92ffbbcae4ae968d51afad 100755 (executable)
@@ -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))
index 5d22153a5ee3289b3cb3ea32f1babe647a4e03c7..2ddb48d7bf652fe2c9bf501dee722b3a931afb3a 100755 (executable)
@@ -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))
index 23b626b4681e43f1444c8b034e37287d11ae34fc..f270ccb4233d5de103946045c61b42db463dc5b3 100755 (executable)
@@ -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')
index 50083e734a7b718c8dd5241469831af4e3dc97b7..23057c08625298923e33f54ca154dec75d493097 100755 (executable)
@@ -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))
index 52ac11fea76accd445d1b414edb86acc132ea2c4..9e22a0244223b2325e7fac5f57daf402a24f7bc7 100755 (executable)
@@ -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))
index fe294c88f2b08a918a92559dbd2b6bcf3b1282ee..9284c55c707aa80d9685d411acef066c7f6b300f 100755 (executable)
@@ -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))
index dd645627f4844a287caf7ec7fb79e2b1e44c8201..086c522980fb55851118c26e0fa8fa276be4fda3 100755 (executable)
@@ -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))
index 5e1a899ffd668661003a443cd1d2f423a79d77c2..6f75b73ec03caa4a378f280b1a6d8333ca7e178a 100755 (executable)
@@ -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))
index 1dc5b723c78e14245e6e0a8f4aa8de8344b304ae..066bf5eac1195d9bb836c0087d81ce361ba13487 100755 (executable)
@@ -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))
index f391685eb52685508798383dd6f1f4d02bddddc5..a69f798c3e77848b86bcbd91d0312894cefdb6e6 100755 (executable)
@@ -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))
index c5fac9e7a0ef52e78d112239c42a43b8e5fb053b..e35597f5e7f6c2b02efdbc1162f77f41b44112a9 100755 (executable)
@@ -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))
index 8077d762b34af0b95f89fad2fa0712fa86a16530..e58d64be84f2835e6c79fefd19de93d93bb3e3e5 100755 (executable)
@@ -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))
index 964580c2a36e6d970783613b5ed6ccb315a1f916..f4f19f8475c94aa1ac050f7dd612af9a4201679e 100755 (executable)
@@ -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
index f7d64957aba77872489dadf6ec462800e8b1ffd1..b14255b63f155f8f918541c7ba703f3c65f45d52 100755 (executable)
@@ -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) ))
index 65c35638dea7d2ce0d14c8a730541d60c4c962a2..cfda8c37fc9e5703475d913448bfce111f5bf20b 100755 (executable)
@@ -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"
index 0d8006fa5c8f6ecf1ba09b9437635d02b1291624..909956fe1d1c085a02f3532b3b70a12ca2f911bd 100755 (executable)
@@ -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"
index 29fa6a001c4a98e05dbf24dc550e7331428e0cb5..d9b868a0fa2380557f2a10d9839d0c787a161f40 100755 (executable)
@@ -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"
index 3843a8bd2fb2bcf02d006d2fdaece923ae73d31f..65113d9acaff567f44f3a99d9c465484d77a8f55 100755 (executable)
@@ -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"
index 6e7f465f6805aa79cd16bba5d3d6a96460bab436..21029efb4978b06f2c16ab5905c3a5388301df21 100755 (executable)
@@ -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"
index d3ee888412ed0b0effcd9e1773f0b7941b3abc53..c54bf06d3d6f81d16f9fe8318b44c195381e194f 100755 (executable)
@@ -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"
index 7de8ad66ab825a79d62fa3a9582c94942beeee68..d7ee57ea303196ecb000d91a47d1b41a55b04881 100755 (executable)
@@ -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"
index daac5509321d9842856924c11af7ce120be5f30d..fa6a33ed2ef1b8f168221aecda9113135af7f370 100755 (executable)
@@ -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"
index a307408b6e9a26302b550417f5dc39967f86161c..3e2c6f4c84882b82dc86b5315ea825ecfdde8160 100755 (executable)
@@ -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() {
index 38e3aaced8b6d42f6011054751aed81101027092..a2f44e8f61ae3c862077fd02ab9a2b681b160c20 100755 (executable)
@@ -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() {
index 93fdc1dba46ba60b9428b3b40eca767371608c38..2b070673664eb0e927952e93e35d123144b810ac 100755 (executable)
@@ -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"
index ae9caa2de9f2dc6b2c338c4dd6bb0d474845a662..1ba3e8ac09e5b4e41cba7d55bcd6e3801257bdf2 100755 (executable)
@@ -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"
index 42970887b41784885e0cd82904493af5d50719cb..919900656c7d0298535f3d323eee1fa203c9e736 100755 (executable)
@@ -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"
index 4ae2b9c634c7e44792ff705fe5b058555234f067..8dfc34242beb7cb43b1ae5b9aaea49cc76a60c09 100755 (executable)
@@ -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?
index e85db1266fa982ccf4630aadcd1fdb2263fe38c1..3f6446c18e6e1093090761ee7efd73b6a6453193 100755 (executable)
@@ -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?
index a513333a8408ba442a5a86e8651d6d0854009222..a196cd416addc0e477f559e45b45368638f9e9e3 100755 (executable)
@@ -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"
index 1600b5aec730576c95e0d69c12a983fdf9e09fb2..b2298cb31a0e3a0783767abd3437368a53ff7d97 100755 (executable)
@@ -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"
index 6b768c934ba1da6290f5755c8ac803efda625759..8212ec39113a445c3d03739ef5ea15341af952f5 100755 (executable)
@@ -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
index 04633a10900e39775fbd8137bcf7f4f13c98dcc6..6bb6282f0b1a23a766cbbf00a54ae426b878e29b 100755 (executable)
@@ -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
index 17ff2388843d07f3fccfeb24e7b18c054002407c..10880e52aa8fdf860e87cb1cba89c5eea959264a 100755 (executable)
@@ -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
 
index b09ccb659589a917426a2a325b0c366a67850868..7f7ebaa3537231b38c8df8623edf4a9ff7257275 100755 (executable)
@@ -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))
index 16193e516241068bd277d6b11b043a7a6c3281e0..b62ef1b58e1adbf130807b40af055e5bcbc31860 100755 (executable)
@@ -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))
index 052c5394fccdcad1732d164a4698e307adc9993c..a87357b0ecf52fd55bd92db1e2e7d798774c8b51 100755 (executable)
@@ -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))
index 996500e12a21b339ab7bfcd4b9364c6e0204b724..acd4b89613157aadb34a56183c6e87e4bde550fd 100755 (executable)
@@ -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
index 00e91a4142a65e25a4c6f9da5f35b88d613cb8e7..e2d336993c4230e3053ffc8b979fed9385f3c595 100755 (executable)
@@ -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"
index b7aa5e7029813ca1242de64011fff23f7bacd587..2545f00362c69d82e8b5a49884ba1a1a40df944c 100755 (executable)
@@ -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"
index 6d32e93a14599a83423171348c8cfa6d95b056c8..e843b4eb5f8028fef62b1bf91cdbc0c9930459e8 100755 (executable)
@@ -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"
index 8594787cf072a42ba83bb0761265b8860e337666..01f5e1c97c16c9fbdd7136498088421fb60476b7 100755 (executable)
@@ -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"
index f59b3bd03f83a80226518adc7ad68aaf04a91310..2cd8880947941c3a1bd61de9774aa63fd432ca00 100755 (executable)
@@ -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"
index c12d915b1bcb1bd5c9b36eeae815de6967f757b2..f55ed23689586e786bf594eb5576c42b474b6eaa 100755 (executable)
@@ -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"
index a750ef64f0a59ddbfcf830fad681608f2e413f36..ebb6e736a87b426c7e7f06409d6cc5d8b21832ed 100755 (executable)
@@ -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"
index ae21d6ee46b8071ecd848dbdf60e0650b82cda0c..6e5b896f63016bc64353bf6b1423d2daab2b4a70 100755 (executable)
@@ -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"
index 4f56884d1744e3eaf5b548c3267b4aa282a09ec6..e64106a9b99c1bbd171efcaf528b0a067ab75724 100755 (executable)
@@ -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"
index 9f01d084492a27baed75fa21f53cf6eeabb1994a..68abaf7e397860462541e46dc236276d2ac9fdf4 100755 (executable)
@@ -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"
index b9c9ab44d7494403fb4474d2536ba34ab3893bd6..c4bb32204b4217571ac208f13b82ac12d0117ca1 100755 (executable)
@@ -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
index 887a13598e392ae0a3729ddc3fdf431d154a6cc0..7fcca82e3df871a69021619edf07e29fc5f3e421 100755 (executable)
@@ -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
index 5ae0714c76f2a25ea16125b2dd9c66c80ca31dd2..f02cc2d259f5aaab9da7a44ad4920a4fe553a724 100755 (executable)
@@ -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
index 3afc75f203e5e80db05862f11cde64b12959f713..1dfcd9698c02ad9ef1c1e8723b7e37e3394e5741 100755 (executable)
@@ -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
index 3f34bcfa035feba5477f078ceddd0ff0ea4a03f1..d93b31121c660435534af9fa94d36ba73a4e3ba7 100755 (executable)
@@ -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
index 91033fa9dcc6e5b2edfddc5dda4cedf40f243842..7a59dbacaf5182d4c82343784d6a728a9df4c118 100755 (executable)
@@ -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
index 22604419135a70ecfca55e43db750feab52016c2..596cdb86f01994ae678ca34c07b0fa933709cc8b 100755 (executable)
@@ -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
index ac702396a187497ecf40ab3f057127c8f5ceb8eb..d3a0dc0b4a9ca7e03aeda439d08cf5880dd08334 100755 (executable)
@@ -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
index 65d7f5133dd7f56293853e61a28408f9831fb9d7..994f5014610fe55d5bc79dca42a24fa283145c04 100755 (executable)
@@ -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
index 73c6267451bbdfc151589addc0fb983e4d5e50a4..f4b9f157b165a51af89d045d593a17ffd197e0f6 100755 (executable)
@@ -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
index d89139a9de3ce7c93db1f17758998297514642aa..54fc46da1498f6f42d6cbd489096b97a2379ff76 100755 (executable)
@@ -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"
index 2438f1fdf01612f2e5da2d2788f6d3e7293881e1..0ffa19897f781f59604d0ca25efded67ea894564 100755 (executable)
@@ -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"
index 8fcf766c076cbc57cca9a9505dbb10ba3158e08f..a0c1612995a3b30f5ba0df4bac0de97e0d94c602 100755 (executable)
@@ -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
index 8dadc34158d62c2ef27c351bbbe57753bbea8617..9a60ec6f34d5d87f410ac2d35ac87830602872e5 100755 (executable)
@@ -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
index c7b3a198491147e036bdc8c07dc8bd32eb147936..e5840cbd8a35ea2a1aa323c26179ae13d2f64f97 100755 (executable)
@@ -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
index 2039d9cd9addc13c1b3f3b8353849af64707fbd5..c8fb527c4de64fd5fcd3bd902d9baefbc0f3ed60 100755 (executable)
@@ -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
index 3578690e41a4d109640a66f7b529128e65afc7e6..38c04528b0d21497a8941427f0285520cacf470f 100755 (executable)
@@ -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
index 5125773e9542e080d6f54b29db78e7aff32ea3c1..cce21be0a019d97655174267d81dc879605e9a63 100755 (executable)
@@ -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"
index 342fad50323203d2cf6645b043d97f424cee4ccf..33a0befe54177c48a6d6bf0c305cca7c54a21119 100755 (executable)
@@ -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()
 {