diff mbox series

[06/10] btrfs/157: use _btrfs_get_first_logical

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

Commit Message

Christoph Hellwig May 27, 2022, 8:19 a.m. UTC
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>
---
 tests/btrfs/157 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Anand Jain May 30, 2022, 12:44 a.m. UTC | #1
looks good.
Reviewed-by: Anand Jain <anand.jain@oracle.com>


On 5/27/22 13:49, 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>
> ---
>   tests/btrfs/157 | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/btrfs/157 b/tests/btrfs/157
> index 343178b7..022db511 100755
> --- a/tests/btrfs/157
> +++ b/tests/btrfs/157
> @@ -71,7 +71,7 @@ _scratch_mount $(_btrfs_no_v1_cache_opt)
>   $XFS_IO_PROG -f -d -c "pwrite -S 0xaa 0 128K" -c "fsync" \
>   	"$SCRATCH_MNT/foobar" | _filter_xfs_io
>   
> -logical=`${FILEFRAG_PROG} -v $SCRATCH_MNT/foobar | _filter_filefrag | cut -d '#' -f 1`
> +logical=$(_btrfs_get_first_logical $SCRATCH_MNT/foobar)
>   _scratch_unmount
>   
>   phy0=$(get_physical 0)
diff mbox series

Patch

diff --git a/tests/btrfs/157 b/tests/btrfs/157
index 343178b7..022db511 100755
--- a/tests/btrfs/157
+++ b/tests/btrfs/157
@@ -71,7 +71,7 @@  _scratch_mount $(_btrfs_no_v1_cache_opt)
 $XFS_IO_PROG -f -d -c "pwrite -S 0xaa 0 128K" -c "fsync" \
 	"$SCRATCH_MNT/foobar" | _filter_xfs_io
 
-logical=`${FILEFRAG_PROG} -v $SCRATCH_MNT/foobar | _filter_filefrag | cut -d '#' -f 1`
+logical=$(_btrfs_get_first_logical $SCRATCH_MNT/foobar)
 _scratch_unmount
 
 phy0=$(get_physical 0)