From 91cb623078b32ae1c6180ccd4098dbf776918220 Mon Sep 17 00:00:00 2001 From: Johannes Thumshirn Date: Wed, 13 Dec 2023 03:35:25 -0800 Subject: common: add _require_btrfs_free_space_tree Reviewed-by: Filipe Manana Reviewed-by: Anand Jain Signed-off-by: Johannes Thumshirn Signed-off-by: Anand Jain Signed-off-by: Zorro Lang --- common/btrfs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/common/btrfs b/common/btrfs index 9dd2a7f4..e1b29c61 100644 --- a/common/btrfs +++ b/common/btrfs @@ -127,6 +127,16 @@ _require_btrfs_no_nodatacow() fi } +_require_btrfs_free_space_tree() +{ + _scratch_mkfs > /dev/null 2>&1 + if ! $BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | \ + grep -q "FREE_SPACE_TREE" + then + _notrun "This test requires a free-space-tree" + fi +} + _check_btrfs_filesystem() { device=$1 -- cgit v1.2.3