From 008ffc6232320acf3699a4868b0aabaa3caa7934 Mon Sep 17 00:00:00 2001 From: Anand Jain Date: Thu, 17 Apr 2025 20:27:22 +0800 Subject: [PATCH] fstests: common/btrfs: add _ prefix to temp fsid helper functions Just adding a _ prefix to the two temp fsid helper functions and a rename in common/btrfs to keep the coding style consistent. Reviewed-by: Zorro Lang Reviewed-by: Josef Bacik Signed-off-by: Anand Jain --- common/btrfs | 6 +++--- tests/btrfs/311 | 4 ++-- tests/btrfs/313 | 6 +++--- tests/btrfs/314 | 2 +- tests/btrfs/315 | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/common/btrfs b/common/btrfs index 3725632c..6a1095ff 100644 --- a/common/btrfs +++ b/common/btrfs @@ -942,7 +942,7 @@ _has_btrfs_sysfs_feature_attr() # Print the fsid and metadata uuid replaced with constant strings FSID and # METADATA_UUID. Compare temp_fsid with fsid and metadata_uuid, then echo what # it matches to or TEMP_FSID. This helps in comparing with the golden output. -check_fsid() +_check_temp_fsid() { local dev1=$1 local fsid @@ -979,7 +979,7 @@ check_fsid() cat /sys/fs/btrfs/$tempfsid/temp_fsid } -mkfs_clone() +_btrfs_mkfs_clone() { local fsid local uuid @@ -990,7 +990,7 @@ mkfs_clone() _require_btrfs_mkfs_uuid_option [[ -z $dev1 || -z $dev2 ]] && \ - _fail "mkfs_clone requires two devices as arguments" + _fail "_btrfs_mkfs_clone requires two devices as arguments" _mkfs_dev -fq $dev1 diff --git a/tests/btrfs/311 b/tests/btrfs/311 index 51147c59..9ac997db 100755 --- a/tests/btrfs/311 +++ b/tests/btrfs/311 @@ -47,7 +47,7 @@ same_dev_mount() md5sum $SCRATCH_MNT/foo | _filter_scratch md5sum $mnt1/bar | _filter_test_dir - check_fsid $SCRATCH_DEV + _check_temp_fsid $SCRATCH_DEV } same_dev_subvol_mount() @@ -69,7 +69,7 @@ same_dev_subvol_mount() md5sum $SCRATCH_MNT/subvol/foo | _filter_scratch md5sum $mnt1/bar | _filter_test_dir - check_fsid $SCRATCH_DEV + _check_temp_fsid $SCRATCH_DEV } same_dev_mount diff --git a/tests/btrfs/313 b/tests/btrfs/313 index 5a9e98de..7d09aaad 100755 --- a/tests/btrfs/313 +++ b/tests/btrfs/313 @@ -30,15 +30,15 @@ mnt1=$TEST_DIR/$seq/mnt1 mkdir -p $mnt1 echo ---- clone_uuids_verify_tempfsid ---- -mkfs_clone ${SCRATCH_DEV_NAME[0]} ${SCRATCH_DEV_NAME[1]} +_btrfs_mkfs_clone ${SCRATCH_DEV_NAME[0]} ${SCRATCH_DEV_NAME[1]} echo Mounting original device _mount ${SCRATCH_DEV_NAME[0]} $SCRATCH_MNT -check_fsid ${SCRATCH_DEV_NAME[0]} +_check_temp_fsid ${SCRATCH_DEV_NAME[0]} echo Mounting cloned device _mount ${SCRATCH_DEV_NAME[1]} $mnt1 -check_fsid ${SCRATCH_DEV_NAME[1]} +_check_temp_fsid ${SCRATCH_DEV_NAME[1]} $XFS_IO_PROG -fc 'pwrite -S 0x61 0 9000' $SCRATCH_MNT/foo | _filter_xfs_io echo cp reflink must fail diff --git a/tests/btrfs/314 b/tests/btrfs/314 index d931da8f..01646157 100755 --- a/tests/btrfs/314 +++ b/tests/btrfs/314 @@ -36,7 +36,7 @@ send_receive_tempfsid() local dst=$2 # Use first 2 devices from the SCRATCH_DEV_POOL - mkfs_clone ${SCRATCH_DEV} ${SCRATCH_DEV_NAME[1]} + _btrfs_mkfs_clone ${SCRATCH_DEV} ${SCRATCH_DEV_NAME[1]} _scratch_mount _mount $(_common_dev_mount_options) ${SCRATCH_DEV_NAME[1]} ${tempfsid_mnt} diff --git a/tests/btrfs/315 b/tests/btrfs/315 index f8785e83..b9fdba6a 100755 --- a/tests/btrfs/315 +++ b/tests/btrfs/315 @@ -32,7 +32,7 @@ seed_device_must_fail() { echo ---- $FUNCNAME ---- - mkfs_clone ${SCRATCH_DEV} ${SCRATCH_DEV_NAME[1]} + _btrfs_mkfs_clone ${SCRATCH_DEV} ${SCRATCH_DEV_NAME[1]} $BTRFS_TUNE_PROG -S 1 ${SCRATCH_DEV} $BTRFS_TUNE_PROG -S 1 ${SCRATCH_DEV_NAME[1]} @@ -45,7 +45,7 @@ device_add_must_fail() { echo ---- $FUNCNAME ---- - mkfs_clone ${SCRATCH_DEV} ${SCRATCH_DEV_NAME[1]} + _btrfs_mkfs_clone ${SCRATCH_DEV} ${SCRATCH_DEV_NAME[1]} _scratch_mount _mount ${SCRATCH_DEV_NAME[1]} ${tempfsid_mnt} -- 2.39.5