]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
btrfs/215: use _btrfs_get_first_logical
authorChristoph Hellwig <hch@lst.de>
Fri, 27 May 2022 08:19:12 +0000 (10:19 +0200)
committerZorro Lang <zlang@kernel.org>
Sat, 28 May 2022 07:11:59 +0000 (15:11 +0800)
Use the _btrfs_get_first_logical helper instead of open coding it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/215

index 0dcbce2a888ecdb8792f4dee288dd4cfb429ee15..928f365c35c035d3ff7df0e73b79bd501f63e698 100755 (executable)
@@ -56,7 +56,7 @@ fi
 #create an 8 block file
 $XFS_IO_PROG -d -f -c "pwrite -S 0xbb -b $filesize 0 $filesize" "$SCRATCH_MNT/foobar" > /dev/null
 
-logical_extent=$($FILEFRAG_PROG -v "$SCRATCH_MNT/foobar" | _filter_filefrag | cut -d '#' -f 1)
+logical_extent=$(_btrfs_get_first_logical $SCRATCH_MNT/foobar)
 physical_extent=$(get_physical $logical_extent)
 
 echo "logical = $logical_extent physical=$physical_extent" >> $seqres.full