common: use _require_xfs_io_command() directly to check fiemap

1) _require_fiemap and _require_xfs_io_command "fiemap" do the
   same thing, but some test cases use the former and some use
   the latter, so i feel they should be unified.

2) The number of helpers like this is slowly growing, but it's
   easy to simply use _require_xfs_io_command directly and just
   specify the command we want to check.

This is just a cleanup for keeping it simple.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Xiao Yang
2017-05-17 09:42:32 +08:00
committed by Eryu Guan
parent 777e1d6280
commit eaa2d30dba
43 changed files with 42 additions and 54 deletions
-12
View File
@@ -2940,12 +2940,6 @@ _require_metadata_journaling()
esac esac
} }
# Does fiemap support?
_require_fiemap()
{
_require_xfs_io_command "fiemap"
}
_count_extents() _count_extents()
{ {
$XFS_IO_PROG -c "fiemap" $1 | tail -n +2 | grep -v hole | wc -l $XFS_IO_PROG -c "fiemap" $1 | tail -n +2 | grep -v hole | wc -l
@@ -2956,12 +2950,6 @@ _count_holes()
$XFS_IO_PROG -c "fiemap" $1 | tail -n +2 | grep hole | wc -l $XFS_IO_PROG -c "fiemap" $1 | tail -n +2 | grep hole | wc -l
} }
# Does fiemap support reporting xattr extents?
_require_fiemap_attr()
{
_require_xfs_io_command "fiemap" "-a"
}
_count_attr_extents() _count_attr_extents()
{ {
$XFS_IO_PROG -c "fiemap -a" $1 | tail -n +2 | grep -v hole | wc -l $XFS_IO_PROG -c "fiemap -a" $1 | tail -n +2 | grep -v hole | wc -l
+1 -1
View File
@@ -111,7 +111,7 @@ _require_scratch_reflink()
_require_scratch_explicit_shared_extents() _require_scratch_explicit_shared_extents()
{ {
_require_scratch _require_scratch
_require_fiemap _require_xfs_io_command "fiemap"
_require_scratch_reflink _require_scratch_reflink
_require_xfs_io_command "reflink" _require_xfs_io_command "reflink"
local nr_extents local nr_extents
+1 -1
View File
@@ -41,7 +41,7 @@ _supported_os Linux IRIX
_require_scratch _require_scratch
_require_scratch_shutdown _require_scratch_shutdown
_require_fiemap _require_xfs_io_command "fiemap"
_scratch_mkfs >/dev/null 2>&1 _scratch_mkfs >/dev/null 2>&1
_require_metadata_journaling $SCRATCH_DEV _require_metadata_journaling $SCRATCH_DEV
_scratch_mount _scratch_mount
+1 -1
View File
@@ -41,7 +41,7 @@ _supported_os Linux IRIX
_require_scratch _require_scratch
_require_scratch_shutdown _require_scratch_shutdown
_require_fiemap _require_xfs_io_command "fiemap"
_scratch_mkfs >/dev/null 2>&1 _scratch_mkfs >/dev/null 2>&1
_require_metadata_journaling $SCRATCH_DEV _require_metadata_journaling $SCRATCH_DEV
_scratch_mount _scratch_mount
+1 -1
View File
@@ -41,7 +41,7 @@ _supported_os Linux IRIX
_require_scratch _require_scratch
_require_scratch_shutdown _require_scratch_shutdown
_require_fiemap _require_xfs_io_command "fiemap"
_scratch_mkfs >/dev/null 2>&1 _scratch_mkfs >/dev/null 2>&1
_require_metadata_journaling $SCRATCH_DEV _require_metadata_journaling $SCRATCH_DEV
_scratch_mount _scratch_mount
+1 -1
View File
@@ -41,7 +41,7 @@ _supported_os Linux IRIX
_require_scratch _require_scratch
_require_scratch_shutdown _require_scratch_shutdown
_require_fiemap _require_xfs_io_command "fiemap"
_scratch_mkfs >/dev/null 2>&1 _scratch_mkfs >/dev/null 2>&1
_require_metadata_journaling $SCRATCH_DEV _require_metadata_journaling $SCRATCH_DEV
_scratch_mount _scratch_mount
+1 -1
View File
@@ -42,7 +42,7 @@ _supported_os Linux IRIX
_require_scratch _require_scratch
_require_scratch_shutdown _require_scratch_shutdown
_require_fiemap _require_xfs_io_command "fiemap"
_scratch_mkfs >/dev/null 2>&1 _scratch_mkfs >/dev/null 2>&1
_require_metadata_journaling $SCRATCH_DEV _require_metadata_journaling $SCRATCH_DEV
_scratch_mount _scratch_mount
+1 -1
View File
@@ -42,7 +42,7 @@ _supported_os Linux IRIX
_require_scratch _require_scratch
_require_scratch_shutdown _require_scratch_shutdown
_require_fiemap _require_xfs_io_command "fiemap"
_scratch_mkfs >/dev/null 2>&1 _scratch_mkfs >/dev/null 2>&1
_require_metadata_journaling $SCRATCH_DEV _require_metadata_journaling $SCRATCH_DEV
_scratch_mount _scratch_mount
+1 -1
View File
@@ -42,7 +42,7 @@ _supported_os Linux IRIX
_require_scratch _require_scratch
_require_scratch_shutdown _require_scratch_shutdown
_require_fiemap _require_xfs_io_command "fiemap"
_scratch_mkfs >/dev/null 2>&1 _scratch_mkfs >/dev/null 2>&1
_require_metadata_journaling $SCRATCH_DEV _require_metadata_journaling $SCRATCH_DEV
_scratch_mount _scratch_mount
+1 -1
View File
@@ -53,7 +53,7 @@ _supported_fs generic
_supported_os Linux _supported_os Linux
_require_test _require_test
_require_xfs_io_command "falloc" _require_xfs_io_command "falloc"
_require_fiemap _require_xfs_io_command "fiemap"
# First test to make sure that truncating at i_size trims the preallocated bit # First test to make sure that truncating at i_size trims the preallocated bit
# past i_size # past i_size
+1 -1
View File
@@ -47,7 +47,7 @@ _cleanup()
_supported_os Linux _supported_os Linux
_require_scratch_reflink _require_scratch_reflink
_require_cp_reflink _require_cp_reflink
_require_fiemap _require_xfs_io_command "fiemap"
rm -f $seqres.full rm -f $seqres.full
+1 -1
View File
@@ -47,7 +47,7 @@ _cleanup()
_supported_os Linux _supported_os Linux
_require_scratch_reflink _require_scratch_reflink
_require_cp_reflink _require_cp_reflink
_require_fiemap _require_xfs_io_command "fiemap"
_require_odirect _require_odirect
rm -f $seqres.full rm -f $seqres.full
+1 -1
View File
@@ -46,7 +46,7 @@ _cleanup()
_supported_os Linux _supported_os Linux
_require_scratch_reflink _require_scratch_reflink
_require_cp_reflink _require_cp_reflink
_require_fiemap _require_xfs_io_command "fiemap"
_require_quota _require_quota
_require_nobody _require_nobody
_require_user _require_user
+1 -1
View File
@@ -46,7 +46,7 @@ _cleanup()
_supported_os Linux _supported_os Linux
_require_scratch_reflink _require_scratch_reflink
_require_cp_reflink _require_cp_reflink
_require_fiemap _require_xfs_io_command "fiemap"
_require_quota _require_quota
_require_nobody _require_nobody
_require_odirect _require_odirect
+1 -1
View File
@@ -45,7 +45,7 @@ _cleanup()
_supported_os Linux _supported_os Linux
_require_scratch_reflink _require_scratch_reflink
_require_cp_reflink _require_cp_reflink
_require_fiemap _require_xfs_io_command "fiemap"
_require_quota _require_quota
_require_nobody _require_nobody
_require_user _require_user
+1 -1
View File
@@ -45,7 +45,7 @@ _cleanup()
_supported_os Linux _supported_os Linux
_require_scratch_reflink _require_scratch_reflink
_require_cp_reflink _require_cp_reflink
_require_fiemap _require_xfs_io_command "fiemap"
_require_quota _require_quota
_require_nobody _require_nobody
_require_odirect _require_odirect
+1 -1
View File
@@ -55,7 +55,7 @@ rm -f $seqres.full
_supported_fs generic _supported_fs generic
_supported_os Linux _supported_os Linux
_require_scratch_reflink _require_scratch_reflink
_require_fiemap _require_xfs_io_command "fiemap"
_scratch_mkfs > /dev/null 2>&1 _scratch_mkfs > /dev/null 2>&1
_scratch_mount _scratch_mount
+1 -1
View File
@@ -56,7 +56,7 @@ rm -f $seqres.full
_supported_fs generic _supported_fs generic
_supported_os Linux _supported_os Linux
_require_scratch_reflink _require_scratch_reflink
_require_fiemap _require_xfs_io_command "fiemap"
_scratch_mkfs > /dev/null 2>&1 _scratch_mkfs > /dev/null 2>&1
_scratch_mount _scratch_mount
+1 -1
View File
@@ -46,7 +46,7 @@ _cleanup()
_supported_os Linux _supported_os Linux
_supported_fs generic _supported_fs generic
_require_scratch_reflink _require_scratch_reflink
_require_fiemap _require_xfs_io_command "fiemap"
_require_scratch_explicit_shared_extents _require_scratch_explicit_shared_extents
echo "Format and mount" echo "Format and mount"
+1 -1
View File
@@ -47,7 +47,7 @@ _cleanup()
_supported_os Linux _supported_os Linux
_supported_fs generic _supported_fs generic
_require_scratch_reflink _require_scratch_reflink
_require_fiemap _require_xfs_io_command "fiemap"
echo "Format and mount" echo "Format and mount"
_scratch_mkfs > $seqres.full 2>&1 _scratch_mkfs > $seqres.full 2>&1

Some files were not shown because too many files have changed in this diff Show More