]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
common: generalize _filter_agno
authorChristoph Hellwig <hch@lst.de>
Thu, 8 May 2025 05:34:30 +0000 (07:34 +0200)
committerZorro Lang <zlang@kernel.org>
Thu, 8 May 2025 19:17:17 +0000 (03:17 +0800)
Rename and move to common/xfs so that it can be reused for rgnos in new
zoned tests.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/filestreams
common/xfs

index bb8459405b3e25b879bffa4fb40bc46e6256d0d8..ace8f3b74de6c7be232161fee5bbf535a84e6fa5 100644 (file)
@@ -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
 }
 
index 39650bac6c235adbd112fdb84d56f526b7a29d9f..061ca586c84f0524f4b896a5c44f606b3eb5a053 100644 (file)
@@ -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 "} ;
+        '
+}