mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
btrfs/124: add balance --full-balance option
btrfs balance needs --full-balance option since 4.6, so check the version and then use it. As this may be useful for other btrfs tests as well, so this patch also adds _run_btrfs_balance_start() to the common/btrfs file. Signed-off-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
@@ -356,3 +356,14 @@ _btrfs_compression_algos()
|
|||||||
echo "${feature#/sys/fs/btrfs/features/compress_}"
|
echo "${feature#/sys/fs/btrfs/features/compress_}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# run btrfs balance start with required --full-balance if available.
|
||||||
|
_run_btrfs_balance_start()
|
||||||
|
{
|
||||||
|
local bal_opt=""
|
||||||
|
|
||||||
|
$BTRFS_UTIL_PROG balance start --help | grep -q "full-balance"
|
||||||
|
(( $? == 0 )) && bal_opt="--full-balance"
|
||||||
|
|
||||||
|
run_check $BTRFS_UTIL_PROG balance start $bal_opt $*
|
||||||
|
}
|
||||||
|
|||||||
+1
-1
@@ -129,7 +129,7 @@ _run_btrfs_util_prog device scan
|
|||||||
_scratch_mount >> $seqres.full 2>&1
|
_scratch_mount >> $seqres.full 2>&1
|
||||||
_run_btrfs_util_prog filesystem show
|
_run_btrfs_util_prog filesystem show
|
||||||
echo >> $seqres.full
|
echo >> $seqres.full
|
||||||
_run_btrfs_util_prog balance start ${SCRATCH_MNT}
|
_run_btrfs_balance_start ${SCRATCH_MNT}
|
||||||
|
|
||||||
checkpoint2=`md5sum $SCRATCH_MNT/tf2`
|
checkpoint2=`md5sum $SCRATCH_MNT/tf2`
|
||||||
echo $checkpoint2 >> $seqres.full 2>&1
|
echo $checkpoint2 >> $seqres.full 2>&1
|
||||||
|
|||||||
Reference in New Issue
Block a user