mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
common: add leading underscore to get_block_size
Add a leading underscore to the get_block_size helper since it's a common function. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
committed by
Eryu Guan
parent
daedb4dc13
commit
0bfb84110b
+2
-2
@@ -257,7 +257,7 @@ _sort_getfattr_output()
|
||||
if [ "$FSTYP" == "xfs" -o "$FSTYP" == "udf" ]; then
|
||||
MAX_ATTRS=1000
|
||||
else # Assume max ~1 block of attrs
|
||||
BLOCK_SIZE=`get_block_size $TEST_DIR`
|
||||
BLOCK_SIZE=`_get_block_size $TEST_DIR`
|
||||
# user.attribute_XXX="value.XXX" is about 32 bytes; leave some overhead
|
||||
let MAX_ATTRS=$BLOCK_SIZE/40
|
||||
fi
|
||||
@@ -268,7 +268,7 @@ export MAX_ATTRS
|
||||
if [ "$FSTYP" == "xfs" -o "$FSTYP" == "udf" -o "$FSTYP" == "btrfs" ]; then
|
||||
MAX_ATTRVAL_SIZE=64
|
||||
else # Assume max ~1 block of attrs
|
||||
BLOCK_SIZE=`get_block_size $TEST_DIR`
|
||||
BLOCK_SIZE=`_get_block_size $TEST_DIR`
|
||||
# leave a little overhead
|
||||
let MAX_ATTRVAL_SIZE=$BLOCK_SIZE-256
|
||||
fi
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ _require_defrag()
|
||||
ext4|ext4dev)
|
||||
testfile="$TEST_DIR/$$-test.defrag"
|
||||
donorfile="$TEST_DIR/$$-donor.defrag"
|
||||
bsize=`get_block_size $TEST_DIR`
|
||||
bsize=`_get_block_size $TEST_DIR`
|
||||
$XFS_IO_PROG -f -c "pwrite -b $bsize 0 $bsize" $testfile > /dev/null
|
||||
cp $testfile $donorfile
|
||||
echo $testfile | $here/src/e4compact -v -f $donorfile | \
|
||||
|
||||
+2
-2
@@ -265,7 +265,7 @@ _filter_xfs_io_units_modified()
|
||||
|
||||
_filter_xfs_io_blocks_modified()
|
||||
{
|
||||
BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
|
||||
BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
|
||||
|
||||
_filter_xfs_io_units_modified "Block" $BLOCK_SIZE
|
||||
}
|
||||
@@ -383,7 +383,7 @@ _filter_ro_mount() {
|
||||
|
||||
_filter_od()
|
||||
{
|
||||
BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
|
||||
BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
|
||||
$AWK_PROG -v block_size=$BLOCK_SIZE '
|
||||
/^[0-9]+/ {
|
||||
offset = strtonum("0"$1);
|
||||
|
||||
+1
-1
@@ -584,7 +584,7 @@ _test_generic_punch()
|
||||
if [ "$remove_testfile" ]; then
|
||||
rm -f $testfile
|
||||
fi
|
||||
block_size=`get_block_size $TEST_DIR`
|
||||
block_size=`_get_block_size $TEST_DIR`
|
||||
$XFS_IO_PROG -f -c "truncate $block_size" \
|
||||
-c "pwrite 0 $block_size" $sync_cmd \
|
||||
-c "$zero_cmd 128 128" \
|
||||
|
||||
@@ -3125,10 +3125,10 @@ _sysfs_dev()
|
||||
echo /sys/dev/block/$_maj:$_min
|
||||
}
|
||||
|
||||
get_block_size()
|
||||
_get_block_size()
|
||||
{
|
||||
if [ -z $1 ] || [ ! -d $1 ]; then
|
||||
echo "Missing mount point argument for get_block_size"
|
||||
echo "Missing mount point argument for _get_block_size"
|
||||
exit 1
|
||||
fi
|
||||
echo `stat -f -c %S $1`
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ _require_command "$E2FSCK_PROG" e2fsck
|
||||
|
||||
rm -f $seqres.full
|
||||
|
||||
BLOCK_SIZE=`get_block_size $TEST_DIR`
|
||||
BLOCK_SIZE=`_get_block_size $TEST_DIR`
|
||||
|
||||
# Create & populate an ext4 filesystem
|
||||
$MKFS_EXT4_PROG -F -b $BLOCK_SIZE $SCRATCH_DEV > $seqres.full 2>&1 || \
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ rm -f $seqres.full
|
||||
_scratch_mkfs "--nodesize 65536" >>$seqres.full 2>&1
|
||||
_scratch_mount
|
||||
|
||||
BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
|
||||
BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
|
||||
EXTENT_SIZE=$((2 * $BLOCK_SIZE))
|
||||
|
||||
$XFS_IO_PROG -f -d -c "pwrite 0 $EXTENT_SIZE" $SCRATCH_MNT/foo \
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ test_btrfs_clone_same_file()
|
||||
_scratch_mkfs >/dev/null 2>&1
|
||||
_scratch_mount $MOUNT_OPTIONS
|
||||
|
||||
BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
|
||||
BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
|
||||
|
||||
EXTENT_SIZE=$((2 * $BLOCK_SIZE))
|
||||
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ test_btrfs_clone_with_holes()
|
||||
_scratch_mkfs "$1" >/dev/null 2>&1
|
||||
_scratch_mount
|
||||
|
||||
BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
|
||||
BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
|
||||
|
||||
EXTENT_SIZE=$((2 * $BLOCK_SIZE))
|
||||
|
||||
|
||||
+1
-1
@@ -67,7 +67,7 @@ test_btrfs_clone_fsync_log_recover()
|
||||
MOUNT_OPTIONS="$MOUNT_OPTIONS $2"
|
||||
_mount_flakey
|
||||
|
||||
BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
|
||||
BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
|
||||
|
||||
EXTENT_SIZE=$((2 * $BLOCK_SIZE))
|
||||
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ mkdir $send_files_dir
|
||||
_scratch_mkfs >>$seqres.full 2>&1
|
||||
_scratch_mount "-o compress"
|
||||
|
||||
BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
|
||||
BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
|
||||
|
||||
# Create the file with a single extent of 32 blocks. This creates a metadata
|
||||
# file extent item with a data start offset of 0 and a logical length of
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ _scratch_mkfs >>$seqres.full 2>&1
|
||||
_init_flakey
|
||||
_mount_flakey
|
||||
|
||||
BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
|
||||
BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
|
||||
|
||||
# Create prealloc extent covering file block range [40, 155[
|
||||
$XFS_IO_PROG -f -c "falloc $((40 * $BLOCK_SIZE)) $((115 * $BLOCK_SIZE))" \
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ rm -f $seqres.full
|
||||
_scratch_mkfs >>$seqres.full 2>&1
|
||||
_scratch_mount
|
||||
|
||||
BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
|
||||
BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
|
||||
|
||||
# Create our test files. File foo has the same 2k of data at offset $BLOCK_SIZE
|
||||
# as file bar has at its offset 0.
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ mkdir $send_files_dir
|
||||
_scratch_mkfs >>$seqres.full 2>&1
|
||||
_scratch_mount
|
||||
|
||||
BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
|
||||
BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
|
||||
|
||||
# Create our test file with a single extent of 16 blocks starting at a file
|
||||
# offset mapped by 32nd block.
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ _scratch_mkfs >>$seqres.full 2>&1
|
||||
_init_flakey
|
||||
_mount_flakey
|
||||
|
||||
BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
|
||||
BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
|
||||
|
||||
# Create our test file with a single 25 block extent starting at file offset
|
||||
# mapped by 200th block We fsync the file here to make the fsync log tree get a
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ test_clone_and_read_compressed_extent()
|
||||
_scratch_mkfs >>$seqres.full 2>&1
|
||||
_scratch_mount $mount_opts
|
||||
|
||||
BLOCK_SIZE=$(get_block_size $SCRATCH_MNT)
|
||||
BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
|
||||
|
||||
# Create a test file with a single extent that is compressed (the
|
||||
# data we write into it is highly compressible no matter which
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ _scratch_mount
|
||||
testfile=$SCRATCH_MNT/$seq.$$
|
||||
BLOCKS=10240
|
||||
|
||||
BSIZE=`get_block_size $SCRATCH_MNT`
|
||||
BSIZE=`_get_block_size $SCRATCH_MNT`
|
||||
|
||||
length=$(($BLOCKS * $BSIZE))
|
||||
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ _require_xfs_io_command "fcollapse"
|
||||
src=$SCRATCH_MNT/testfile
|
||||
dest=$SCRATCH_MNT/testfile.dest
|
||||
BLOCKS=100
|
||||
BSIZE=`get_block_size $SCRATCH_MNT`
|
||||
BSIZE=`_get_block_size $SCRATCH_MNT`
|
||||
rm -f $seqres.full
|
||||
|
||||
_scratch_mkfs >> $seqres.full 2>&1 || _fail "mkfs failed"
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ rm -rf $testdir
|
||||
mkdir $testdir
|
||||
|
||||
echo "Create the original file blocks"
|
||||
blksz="$(get_block_size $testdir)"
|
||||
blksz="$(_get_block_size $testdir)"
|
||||
blks=2000
|
||||
margin='15%'
|
||||
sz=$((blksz * blks))
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ rm -rf $testdir
|
||||
mkdir $testdir
|
||||
|
||||
echo "Create the original file blocks"
|
||||
blksz="$(get_block_size $testdir)"
|
||||
blksz="$(_get_block_size $testdir)"
|
||||
blks=2000
|
||||
margin='15%'
|
||||
sz=$((blksz * blks))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user