]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common: rename get_page_size to _get_page_size
authorDarrick J. Wong <djwong@kernel.org>
Tue, 29 Aug 2023 23:03:43 +0000 (16:03 -0700)
committerZorro Lang <zlang@kernel.org>
Sat, 2 Sep 2023 05:54:38 +0000 (13:54 +0800)
This function does not follow the naming convention that common helpers
must start with an underscore.  Fix this.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
30 files changed:
common/btrfs
common/filter
common/rc
common/verity
tests/btrfs/049
tests/btrfs/106
tests/btrfs/173
tests/btrfs/174
tests/btrfs/175
tests/btrfs/176
tests/btrfs/192
tests/btrfs/215
tests/btrfs/251
tests/btrfs/271
tests/btrfs/274
tests/btrfs/293
tests/ext4/003
tests/ext4/022
tests/ext4/306
tests/generic/416
tests/generic/472
tests/generic/495
tests/generic/496
tests/generic/497
tests/generic/574
tests/generic/636
tests/generic/641
tests/xfs/513
tests/xfs/552
tests/xfs/559

index 0fec093d17359fab52a044cdef2323d77945dc98..c9903a413cb039b7222705c18346ad95513d4490 100644 (file)
@@ -489,7 +489,7 @@ _require_btrfs_support_sectorsize()
        local sectorsize=$1
 
        # PAGE_SIZE as sectorsize is always supported
-       if [ $sectorsize -eq $(get_page_size) ]; then
+       if [ $sectorsize -eq $(_get_page_size) ]; then
                return
        fi
 
index f10ba78a04f66fec653b8b3ceb2dafdf674c849f..509ee95039ac3284922f3db281cd0e515213afb2 100644 (file)
@@ -228,7 +228,7 @@ _filter_xfs_io_blocks_modified()
 
 _filter_xfs_io_pages_modified()
 {
-       PAGE_SIZE=$(get_page_size)
+       PAGE_SIZE=$(_get_page_size)
 
        _filter_xfs_io_units_modified "Page" $PAGE_SIZE
 }
index b5bf3c3bcb477ab6a6cb1f095e5a2bee1dad5d3c..1618ded544bc9788aa06a0a78b6b558475630972 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1100,7 +1100,7 @@ _scratch_mkfs_blocksized()
        if ! [[ $blocksize =~ $re ]] ; then
                _notrun "error: _scratch_mkfs_sized: block size \"$blocksize\" not an integer."
        fi
-       if [ $blocksize -lt $(get_page_size) ]; then
+       if [ $blocksize -lt $(_get_page_size) ]; then
                _exclude_scratch_mount_option dax
        fi
 
@@ -2808,7 +2808,7 @@ _require_scratch_swapfile()
        _scratch_mount
 
        # Minimum size for mkswap is 10 pages
-       _format_swapfile "$SCRATCH_MNT/swap" $(($(get_page_size) * 10)) > /dev/null
+       _format_swapfile "$SCRATCH_MNT/swap" $(($(_get_page_size) * 10)) > /dev/null
 
        # ext* has supported all variants of swap files since their
        # introduction, so swapon should not fail.
@@ -4667,7 +4667,7 @@ _require_file_block_size_equals_fs_block_size()
                _notrun "File allocation unit is larger than a filesystem block"
 }
 
-get_page_size()
+_get_page_size()
 {
        echo $(getconf PAGE_SIZE)
 }
index e09377177d583dbecc6ccb097a2cb8e44d4e0791..03d175ce1b7a18d406fa90bb0790c7afafe1cfa1 100644 (file)
@@ -61,7 +61,7 @@ _require_scratch_verity()
        # Therefore, we default to merkle_tree_block_size == min(fs_block_size,
        # page_size).  That maximizes the chance of verity actually working.
        local fs_block_size=$(_get_block_size $scratch_mnt)
-       local page_size=$(get_page_size)
+       local page_size=$(_get_page_size)
        if (( fs_block_size <= page_size )); then
                FSV_BLOCK_SIZE=$fs_block_size
        else
index 6993050b72027bc8cbcb8313b70002301634e864..9569c141734b7ed4c48b16f5a464dcbdc49ae68c 100755 (executable)
@@ -23,7 +23,7 @@ _spare_dev_get
 swapfile="$SCRATCH_MNT/swap"
 _scratch_pool_mkfs >/dev/null
 _scratch_mount
-_format_swapfile "$swapfile" $(($(get_page_size) * 10)) >/dev/null
+_format_swapfile "$swapfile" $(($(_get_page_size) * 10)) >/dev/null
 
 check_exclusive_ops()
 {
index 7496697f7afd4fb7daaf3b4e79044432f1d008e5..7444e4d5a7cb128d0e3e6bb7865994788aaadad1 100755 (executable)
@@ -26,7 +26,7 @@ test_clone_and_read_compressed_extent()
        _scratch_mkfs >>$seqres.full 2>&1
        _scratch_mount $mount_opts
 
-       PAGE_SIZE=$(get_page_size)
+       PAGE_SIZE=$(_get_page_size)
 
        # Create our test file with 16 pages worth of data in a single extent
        # that is going to be compressed no matter which compression algorithm
index 9f53143eccc4dfae43b23c411fede59809ca7125..4972a5a7059fc75973c141d23aa5cdfa19f244d0 100755 (executable)
@@ -24,14 +24,14 @@ echo "COW file"
 rm -f "$SCRATCH_MNT/swap"
 touch "$SCRATCH_MNT/swap"
 chmod 0600 "$SCRATCH_MNT/swap"
-_pwrite_byte 0x61 0 $(($(get_page_size) * 10)) "$SCRATCH_MNT/swap" >> $seqres.full
+_pwrite_byte 0x61 0 $(($(_get_page_size) * 10)) "$SCRATCH_MNT/swap" >> $seqres.full
 $MKSWAP_PROG "$SCRATCH_MNT/swap" >> $seqres.full
 swapon "$SCRATCH_MNT/swap" 2>&1 | _filter_scratch
 swapoff "$SCRATCH_MNT/swap" >/dev/null 2>&1
 
 echo "Compressed file"
 rm -f "$SCRATCH_MNT/swap"
-_format_swapfile "$SCRATCH_MNT/swap" $(($(get_page_size) * 10)) > /dev/null
+_format_swapfile "$SCRATCH_MNT/swap" $(($(_get_page_size) * 10)) > /dev/null
 $CHATTR_PROG +c "$SCRATCH_MNT/swap" 2>&1 | grep -o "Invalid argument while setting flags"
 
 status=0
index 3bb5e7f91809e73fe09f3577cf37c2adce6550c6..0acd65f0e33899a5022c2c3ecf49f97a460d49ec 100755 (executable)
@@ -20,7 +20,7 @@ _scratch_mount
 
 $BTRFS_UTIL_PROG subvolume create "$SCRATCH_MNT/swapvol" >> $seqres.full
 swapfile="$SCRATCH_MNT/swapvol/swap"
-_format_swapfile "$swapfile" $(($(get_page_size) * 10)) > /dev/null
+_format_swapfile "$swapfile" $(($(_get_page_size) * 10)) > /dev/null
 swapon "$swapfile"
 
 # Turning off nocow doesn't do anything because the file is not empty, not
index db877d419676f06d90aca0917cba14655c48f486..de52c71ee2ef28c0f8afce8c6c19189906913f1a 100755 (executable)
@@ -17,7 +17,7 @@ _require_scratch_swapfile
 _check_minimal_fs_size $((1024 * 1024 * 1024))
 
 cycle_swapfile() {
-       local sz=${1:-$(($(get_page_size) * 10))}
+       local sz=${1:-$(($(_get_page_size) * 10))}
        _format_swapfile "$SCRATCH_MNT/swap" "$sz" > /dev/null
        swapon "$SCRATCH_MNT/swap" 2>&1 | _filter_scratch
        swapoff "$SCRATCH_MNT/swap" > /dev/null 2>&1
@@ -47,7 +47,7 @@ _scratch_mkfs >> $seqres.full 2>&1
 _scratch_mount
 # Create the swap file, then add the device. That way we know it's all on one
 # device.
-_format_swapfile "$SCRATCH_MNT/swap" $(($(get_page_size) * 10)) > /dev/null
+_format_swapfile "$SCRATCH_MNT/swap" $(($(_get_page_size) * 10)) > /dev/null
 scratch_dev2="$(echo "${SCRATCH_DEV_POOL}" | $AWK_PROG '{ print $2 }')"
 $BTRFS_UTIL_PROG device add -f "$scratch_dev2" "$SCRATCH_MNT" >> $seqres.full
 swapon "$SCRATCH_MNT/swap" 2>&1 | _filter_scratch
index 7080d8608b61dbf2a5bf3a0f64c527dd4a264d49..0ddff8d8e62d22483f9bf57ec3a97bf5f33cc474 100755 (executable)
@@ -29,7 +29,7 @@ scratch_dev3="$(echo "${SCRATCH_DEV_POOL}" | $AWK_PROG '{ print $3 }')"
 echo "Remove device"
 _scratch_mkfs >> $seqres.full 2>&1
 _scratch_mount
-_format_swapfile "$SCRATCH_MNT/swap" $(($(get_page_size) * 10)) > /dev/null
+_format_swapfile "$SCRATCH_MNT/swap" $(($(_get_page_size) * 10)) > /dev/null
 $BTRFS_UTIL_PROG device add -f "$scratch_dev2" "$SCRATCH_MNT" >> $seqres.full
 swapon "$SCRATCH_MNT/swap" 2>&1 | _filter_scratch
 # We know the swap file is on device 1 because we added device 2 after it was
@@ -47,7 +47,7 @@ _check_scratch_fs "$scratch_dev2"
 echo "Replace device"
 _scratch_mkfs >> $seqres.full 2>&1
 _scratch_mount
-_format_swapfile "$SCRATCH_MNT/swap" $(($(get_page_size) * 10)) > /dev/null
+_format_swapfile "$SCRATCH_MNT/swap" $(($(_get_page_size) * 10)) > /dev/null
 $BTRFS_UTIL_PROG device add -f "$scratch_dev2" "$SCRATCH_MNT" >> $seqres.full
 swapon "$SCRATCH_MNT/swap" 2>&1 | _filter_scratch
 # Again, we know the swap file is on device 1.
index 7324c9e3983392694f3168cb9b4543df44905e99..ea261b34fbdabc636b81839a7d19dc2d6857942d 100755 (executable)
@@ -41,7 +41,7 @@ _require_scratch
 _require_attrs
 
 # We require a 4K nodesize to ensure the test isn't too slow
-if [ $(get_page_size) -ne 4096 ]; then
+if [ $(_get_page_size) -ne 4096 ]; then
        _notrun "This test doesn't support non-4K page size yet"
 fi
 
index 3daa696aa6363962ada6d9c9b3d26a143e8605da..006468984bf8d7b88c621a2d60dc8eff945f67ab 100755 (executable)
@@ -33,7 +33,7 @@ _scratch_mkfs > /dev/null
 # blobk group
 _scratch_mount $(_btrfs_no_v1_cache_opt)
 
-pagesize=$(get_page_size)
+pagesize=$(_get_page_size)
 blocksize=$(_get_block_size $SCRATCH_MNT)
 
 # For subpage case, since we still do read in full page size, if have 8 corrupted
index 4b6edd6cbeee582194296bd20df8eb6ab10e0f7f..af01095828f5ebe830b4673c16f8d30ecd9d56d2 100755 (executable)
@@ -19,7 +19,7 @@ _begin_fstest auto quick compress dangerous
 _supported_fs btrfs
 _require_scratch
 
-pagesize=$(get_page_size)
+pagesize=$(_get_page_size)
 
 # Read the content from urandom to a known safe location
 $XFS_IO_PROG -f -c "pwrite -i /dev/urandom 0 $pagesize" "$tmp.good" > /dev/null
index c7c95b3e3886974ada06d1840e4442502a05d144..273799f17924c0d1674a0f5fc4c9b96168345d10 100755 (executable)
@@ -25,7 +25,7 @@ _scratch_mount
 
 dev2=`echo $SCRATCH_DEV_POOL | $AWK_PROG '{print $2}'`
 
-pagesize=$(get_page_size)
+pagesize=$(_get_page_size)
 blocksize=$(_get_block_size $SCRATCH_MNT)
 sectors_per_page=$(($pagesize / $blocksize))
 
index c0594e25de51222758b696fd5e41ddaffeb993b8..ec7d66269ad27b52e48a53112c3667fe980d93a8 100755 (executable)
@@ -30,7 +30,7 @@ swap_file="$SCRATCH_MNT/subvol/swap"
 $BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/subvol | _filter_scratch
 
 echo "Creating and activating swap file..."
-_format_swapfile $swap_file $(($(get_page_size) * 32)) >> $seqres.full
+_format_swapfile $swap_file $(($(_get_page_size) * 32)) >> $seqres.full
 _swapon_file $swap_file
 
 echo "Attempting to delete subvolume with swap file enabled..."
index f51d40ddeca7ec7c71c9f241cc7ffbc572060e4a..5cbbee8fd1c68faf5deff3fb27c0eb25ab787ff3 100755 (executable)
@@ -29,7 +29,7 @@ _scratch_mkfs >> $seqres.full 2>&1
 _scratch_mount
 
 swap_file="$SCRATCH_MNT/swapfile"
-_format_swapfile $swap_file $(($(get_page_size) * 64)) >> $seqres.full
+_format_swapfile $swap_file $(($(_get_page_size) * 64)) >> $seqres.full
 
 echo "Creating first snapshot..."
 $BTRFS_UTIL_PROG subvolume snapshot -r $SCRATCH_MNT $SCRATCH_MNT/snap1 | _filter_scratch
index 8ac467b89b9eac728c28211fed4614bc627582b3..a70ad97a910b1eddd93fc61313b79e005ae4545f 100755 (executable)
@@ -26,7 +26,7 @@ _supported_fs ext4
 _require_scratch
 _require_scratch_ext4_feature "bigalloc"
 
-BLOCK_SIZE=$(get_page_size)
+BLOCK_SIZE=$(_get_page_size)
 features=bigalloc
 if echo "${MOUNT_OPTIONS}" | grep -q 'test_dummy_encryption' ; then
     features+=",encrypt"
index 321050b35cde256908ba1106c466add3e6fe747e..96929cb8aa9ef87868995a70cdc191750b4ed49e 100755 (executable)
@@ -27,7 +27,7 @@ _require_attrs
 
 # Block size
 BLOCK_SIZE=4096
-if [[ $(get_page_size) -ne $BLOCK_SIZE ]]; then
+if [[ $(_get_page_size) -ne $BLOCK_SIZE ]]; then
        _exclude_scratch_mount_option dax
 fi
 # Use large inodes to have enough space for experimentation
index db2562848e2d371a17a87c9165089713aebdbf6c..715732a76ec8758a0017454e11cda685eeb0a570 100755 (executable)
@@ -37,7 +37,7 @@ if echo "${MOUNT_OPTIONS}" | grep -q 'test_dummy_encryption' ; then
     features+=",encrypt"
 fi
 
-blksz=$(get_page_size)
+blksz=$(_get_page_size)
 
 $MKFS_EXT4_PROG -F -b $blksz -O "$features" $SCRATCH_DEV 512m >> $seqres.full 2>&1
 _scratch_mount
index deb05f07dd9125a0367ecd941a17253ed058bfe0..0f6e3bc9a17d8390d70e4c3654b6baeceefa6ddb 100755 (executable)
@@ -22,7 +22,7 @@ _supported_fs generic
 _require_scratch
 
 fs_size=$((128 * 1024 * 1024))
-page_size=$(get_page_size)
+page_size=$(_get_page_size)
 
 # We will never reach this number though
 nr_files=$(($fs_size / $page_size))
index a64735caa49f9a4e3ea547a0d3d7845e3f6cae79..7d11ba3700f45b233b0f07593e1a151e39feff97 100755 (executable)
@@ -57,7 +57,7 @@ swapfile_cycle $swapfile $((len + 3))
 # Create a ridiculously small swap file.  Each swap file must have at least
 # two pages after the header page.
 echo "tiny swap" | tee -a $seqres.full
-swapfile_cycle $swapfile $(($(get_page_size) * 3))
+swapfile_cycle $swapfile $(($(_get_page_size) * 3))
 
 status=0
 exit
index 5e03dfee62a56bbb1de94410827275531791319a..84547f18233cc40685ef8de40de9f27d9a366aac 100755 (executable)
@@ -30,7 +30,7 @@ test $blksize -eq $(getconf PAGE_SIZE) || \
 touch "$SCRATCH_MNT/swap"
 $CHATTR_PROG +C "$SCRATCH_MNT/swap" >> $seqres.full 2>&1
 chmod 0600 "$SCRATCH_MNT/swap"
-$XFS_IO_PROG -c "truncate $(($(get_page_size) * 10))" "$SCRATCH_MNT/swap"
+$XFS_IO_PROG -c "truncate $(($(_get_page_size) * 10))" "$SCRATCH_MNT/swap"
 "$here/src/mkswap" "$SCRATCH_MNT/swap"
 "$here/src/swapon" "$SCRATCH_MNT/swap"
 swapoff "$SCRATCH_MNT/swap" >/dev/null 2>&1
index 4aeaffd31946fe46b4e4df4e5c8ef4987f5a3b4e..12f1bc4f94eaa429619552ab0c13cf0124fa452e 100755 (executable)
@@ -33,7 +33,7 @@ _scratch_mount >>$seqres.full 2>&1
 
 swapfile=$SCRATCH_MNT/swap
 len=$((2 * 1048576))
-page_size=$(get_page_size)
+page_size=$(_get_page_size)
 
 swapfile_cycle() {
        local swapfile="$1"
index 6188e3854bb014aa910a45d64a72fcd0da2a108e..05e368ab6f308e87f74142a3960591f35953b840 100755 (executable)
@@ -33,7 +33,7 @@ _scratch_mount >>$seqres.full 2>&1
 
 swapfile=$SCRATCH_MNT/swap
 len=$((2 * 1048576))
-page_size=$(get_page_size)
+page_size=$(_get_page_size)
 
 swapfile_cycle() {
        local swapfile="$1"
index 5d121510798d5d0c2bb7c79e0afb3ab5bb6bb36c..067b3033a81b41ff89df0937ec852a0f5eee5072 100755 (executable)
@@ -55,7 +55,7 @@ setup_zeroed_file()
 round_up_to_page_boundary()
 {
        local n=$1
-       local page_size=$(get_page_size)
+       local page_size=$(_get_page_size)
 
        echo $(( (n + page_size - 1) & ~(page_size - 1) ))
 }
index 10e658b68a551c24debbf700f27e37b06546d84a..afb9df986b5c5d6bd679c54c858d690380f1486d 100755 (executable)
@@ -24,7 +24,7 @@ _scratch_mount
 touch "$SCRATCH_MNT/swap"
 $CHATTR_PROG +C "$SCRATCH_MNT/swap" >> $seqres.full 2>&1
 chmod 0600 "$SCRATCH_MNT/swap"
-_pwrite_byte 0x61 0 $(get_page_size) "$SCRATCH_MNT/swap" >> $seqres.full
+_pwrite_byte 0x61 0 $(_get_page_size) "$SCRATCH_MNT/swap" >> $seqres.full
 "$here/src/mkswap" "$SCRATCH_MNT/swap"
 "$here/src/swapon" "$SCRATCH_MNT/swap"
 swapoff "$SCRATCH_MNT/swap" >/dev/null 2>&1
index 1fd3db2adb395e9172b507d69ed719c566e14967..124f2e1dae9f4ab23f93c3dd44c891865ac09a8d 100755 (executable)
@@ -40,7 +40,7 @@ make_unaligned_swapfile()
 
 _scratch_mkfs >> $seqres.full 2>&1
 _scratch_mount
-psize=`get_page_size`
+psize=`_get_page_size`
 bsize=`_get_file_block_size $SCRATCH_MNT`
 # Due to we need page-unaligned blocks, so blocksize < pagesize is necessary.
 # If not, try to make a smaller enough block size
index eb5ad8ee988be479eba5b760759caf42e6b7e57a..ce2bb34916c90f73da066703d469b93d9920fa55 100755 (executable)
@@ -178,7 +178,7 @@ echo "** start xfs mount testing ..."
 # Test allocsize=size
 # Valid values for this option are page size (typically 4KiB) through to 1GiB
 do_mkfs
-pagesz=$(get_page_size)
+pagesz=$(_get_page_size)
 if [ $pagesz -ge 1024 ];then
        pagesz="$((pagesz / 1024))k"
 fi
index 172ed2065daf781a708765c7dab8a4a1a03d0d42..cb97b2ff6c89ad1e5c90603670a1e35bd4cfa662 100755 (executable)
@@ -30,7 +30,7 @@ mkdir $testdir
 
 echo "Create the original files"
 nr=16
-blksz=$(get_page_size)
+blksz=$(_get_page_size)
 _pwrite_byte 0x61 0 $((blksz * nr)) $testdir/testfile >> $seqres.full
 _pwrite_byte 0x62 0 $((blksz * nr)) $testdir/poisonfile >> $seqres.full
 seq 0 2 $((nr - 1)) | while read i; do
index 92822d26c7f4e6821a9796e939520c38aca86bda..cffe5045a517a1c637d71ba57289ec12ec93f595 100755 (executable)
@@ -42,7 +42,7 @@ $XFS_IO_PROG -c 'chattr -x' $SCRATCH_MNT &> $seqres.full
 _require_pagecache_access $SCRATCH_MNT
 
 blocks=10
-blksz=$(get_page_size)
+blksz=$(_get_page_size)
 filesz=$((blocks * blksz))
 dirty_offset=$(( filesz - 1 ))
 write_len=$(( ( (blocks - 1) * blksz) + 1 ))