diff mbox series

[v5,4/9] common: add _require_btrfs_free_space_tree

Message ID 20231207-btrfs-raid-v5-4-44aa1affe856@wdc.com (mailing list archive)
State New, archived
Headers show
Series fstests: add tests for btrfs' raid-stripe-tree feature | expand

Commit Message

Johannes Thumshirn Dec. 7, 2023, 9:03 a.m. UTC
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 common/btrfs | 10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox series

Patch

diff --git a/common/btrfs b/common/btrfs
index bf69bcee158b..95e46726a801 100644
--- a/common/btrfs
+++ b/common/btrfs
@@ -137,6 +137,16 @@  _require_btrfs_no_block_group_tree()
 	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