diff mbox series

[7/9] btrfs/215: use _btrfs_get_first_logical

Message ID 20220524071838.715013-8-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/9] btrfs: add a helpers for read repair testing | expand

Commit Message

Christoph Hellwig May 24, 2022, 7:18 a.m. UTC
Use the _btrfs_get_first_logical helper instead of open coding it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 tests/btrfs/215 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Qu Wenruo May 24, 2022, 1:21 p.m. UTC | #1
On 2022/5/24 15:18, Christoph Hellwig wrote:
> 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>

Thanks,
Qu

> ---
>   tests/btrfs/215 | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/btrfs/215 b/tests/btrfs/215
> index 0dcbce2a..928f365c 100755
> --- a/tests/btrfs/215
> +++ b/tests/btrfs/215
> @@ -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
diff mbox series

Patch

diff --git a/tests/btrfs/215 b/tests/btrfs/215
index 0dcbce2a..928f365c 100755
--- a/tests/btrfs/215
+++ b/tests/btrfs/215
@@ -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