From: Christoph Hellwig Date: Thu, 8 May 2025 05:34:30 +0000 (+0200) Subject: common: generalize _filter_agno X-Git-Tag: v2025.05.11~17 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=eae2dd124fa141a1e1863af8c5835e8b34dc1642;p=xfstests-dev.git common: generalize _filter_agno Rename and move to common/xfs so that it can be reused for rgnos in new zoned tests. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: Zorro Lang Signed-off-by: Zorro Lang --- diff --git a/common/filestreams b/common/filestreams index bb845940..ace8f3b7 100644 --- a/common/filestreams +++ b/common/filestreams @@ -42,19 +42,10 @@ _do_stream() done } -_filter_agno() -{ - # the ag number is in column 4 of xfs_bmap output - perl -ne ' - $ag = (split /\s+/)[4] ; - if ($ag =~ /\d+/) {print "$ag "} ; - ' -} - _get_stream_ags() { local directory_name=$1 - local stream_ags=`xfs_bmap -vp ${directory_name}/* | _filter_agno` + local stream_ags=`xfs_bmap -vp ${directory_name}/* | _filter_bmap_gno` echo $stream_ags } diff --git a/common/xfs b/common/xfs index 39650bac..061ca586 100644 --- a/common/xfs +++ b/common/xfs @@ -2274,3 +2274,13 @@ _scratch_find_rt_metadir_entry() { return 1 } + +# extract the AG/RTG number from xfs_bmap output +_filter_bmap_gno() +{ + # The AG/RG number is in column 4 of xfs_bmap output + perl -ne ' + $ag = (split /\s+/)[4] ; + if ($ag =~ /\d+/) {print "$ag "} ; + ' +}