Skip to content

Commit

Permalink
common: use _require_xfs_io_command() directly to check fiemap
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
yangx-jy authored and Eryu Guan committed May 17, 2017
1 parent 777e1d6 commit eaa2d30
Show file tree
Hide file tree
Showing 43 changed files with 42 additions and 54 deletions.
12 changes: 0 additions & 12 deletions common/rc
Original file line number Diff line number Diff line change
Expand Up @@ -2940,12 +2940,6 @@ _require_metadata_journaling()
esac
}

# Does fiemap support?
_require_fiemap()
{
_require_xfs_io_command "fiemap"
}

_count_extents()
{
$XFS_IO_PROG -c "fiemap" $1 | tail -n +2 | grep -v hole | wc -l
Expand All @@ -2956,12 +2950,6 @@ _count_holes()
$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()
{
$XFS_IO_PROG -c "fiemap -a" $1 | tail -n +2 | grep -v hole | wc -l
Expand Down
2 changes: 1 addition & 1 deletion common/reflink
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ _require_scratch_reflink()
_require_scratch_explicit_shared_extents()
{
_require_scratch
_require_fiemap
_require_xfs_io_command "fiemap"
_require_scratch_reflink
_require_xfs_io_command "reflink"
local nr_extents
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/043
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ _supported_os Linux IRIX

_require_scratch
_require_scratch_shutdown
_require_fiemap
_require_xfs_io_command "fiemap"
_scratch_mkfs >/dev/null 2>&1
_require_metadata_journaling $SCRATCH_DEV
_scratch_mount
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/044
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ _supported_os Linux IRIX

_require_scratch
_require_scratch_shutdown
_require_fiemap
_require_xfs_io_command "fiemap"
_scratch_mkfs >/dev/null 2>&1
_require_metadata_journaling $SCRATCH_DEV
_scratch_mount
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/045
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ _supported_os Linux IRIX

_require_scratch
_require_scratch_shutdown
_require_fiemap
_require_xfs_io_command "fiemap"
_scratch_mkfs >/dev/null 2>&1
_require_metadata_journaling $SCRATCH_DEV
_scratch_mount
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/046
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ _supported_os Linux IRIX

_require_scratch
_require_scratch_shutdown
_require_fiemap
_require_xfs_io_command "fiemap"
_scratch_mkfs >/dev/null 2>&1
_require_metadata_journaling $SCRATCH_DEV
_scratch_mount
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/047
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ _supported_os Linux IRIX

_require_scratch
_require_scratch_shutdown
_require_fiemap
_require_xfs_io_command "fiemap"
_scratch_mkfs >/dev/null 2>&1
_require_metadata_journaling $SCRATCH_DEV
_scratch_mount
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/048
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ _supported_os Linux IRIX

_require_scratch
_require_scratch_shutdown
_require_fiemap
_require_xfs_io_command "fiemap"
_scratch_mkfs >/dev/null 2>&1
_require_metadata_journaling $SCRATCH_DEV
_scratch_mount
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/049
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ _supported_os Linux IRIX

_require_scratch
_require_scratch_shutdown
_require_fiemap
_require_xfs_io_command "fiemap"
_scratch_mkfs >/dev/null 2>&1
_require_metadata_journaling $SCRATCH_DEV
_scratch_mount
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/092
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ _supported_fs generic
_supported_os Linux
_require_test
_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
# past i_size
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/301
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ _cleanup()
_supported_os Linux
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"

rm -f $seqres.full

Expand Down
2 changes: 1 addition & 1 deletion tests/generic/302
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ _cleanup()
_supported_os Linux
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_odirect

rm -f $seqres.full
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/305
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ _cleanup()
_supported_os Linux
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_quota
_require_nobody
_require_user
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/326
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ _cleanup()
_supported_os Linux
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_quota
_require_nobody
_require_odirect
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/327
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ _cleanup()
_supported_os Linux
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_quota
_require_nobody
_require_user
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/328
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ _cleanup()
_supported_os Linux
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_quota
_require_nobody
_require_odirect
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/352
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ rm -f $seqres.full
_supported_fs generic
_supported_os Linux
_require_scratch_reflink
_require_fiemap
_require_xfs_io_command "fiemap"

_scratch_mkfs > /dev/null 2>&1
_scratch_mount
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/353
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ rm -f $seqres.full
_supported_fs generic
_supported_os Linux
_require_scratch_reflink
_require_fiemap
_require_xfs_io_command "fiemap"

_scratch_mkfs > /dev/null 2>&1
_scratch_mount
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/372
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ _cleanup()
_supported_os Linux
_supported_fs generic
_require_scratch_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_scratch_explicit_shared_extents

echo "Format and mount"
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/414
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ _cleanup()
_supported_os Linux
_supported_fs generic
_require_scratch_reflink
_require_fiemap
_require_xfs_io_command "fiemap"

echo "Format and mount"
_scratch_mkfs > $seqres.full 2>&1
Expand Down
2 changes: 1 addition & 1 deletion tests/generic/425
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ _supported_os Linux
_supported_fs generic
_require_scratch
_require_attrs
_require_fiemap_attr
_require_xfs_io_command "fiemap" "-a"

echo "Format and mount"
_scratch_mkfs > $seqres.full 2>&1
Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/180
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"

rm -f $seqres.full
Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/182
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"
_require_odirect

Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/184
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"
_require_xfs_io_command "funshare"

Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/192
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"
_require_xfs_io_command "funshare"
_require_odirect
Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/193
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"

rm -f $seqres.full
Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/198
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"
_require_odirect

Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/200
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"
_require_xfs_io_command "funshare"

Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/204
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"
_require_xfs_io_command "funshare"
_require_odirect
Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/207
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"

rm -f $seqres.full
Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/208
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"

rm -f $seqres.full
Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/209
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"

rm -f $seqres.full
Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/210
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"

rm -f $seqres.full
Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/211
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"
_require_odirect

Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/212
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"

rm -f $seqres.full

Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/213
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_quota
_require_nobody
_require_xfs_io_command "cowextsize"
Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/214
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_quota
_require_nobody
_require_xfs_io_command "cowextsize"
Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/231
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ _supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_xfs_io_command "cowextsize"
_require_fiemap
_require_xfs_io_command "fiemap"

old_cow_lifetime=$(cat /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime)

Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/232
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ _supported_fs xfs
_require_xfs_io_command "cowextsize"
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"

old_cow_lifetime=$(cat /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime)

Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/344
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"
_require_xfs_io_command "funshare"
_require_odirect
Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/345
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"
_require_xfs_io_command "funshare"

Expand Down
2 changes: 1 addition & 1 deletion tests/xfs/346
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ _supported_os Linux
_supported_fs xfs
_require_scratch_reflink
_require_cp_reflink
_require_fiemap
_require_xfs_io_command "fiemap"
_require_xfs_io_command "cowextsize"
_require_xfs_io_command "funshare"
_require_odirect
Expand Down
Loading

0 comments on commit eaa2d30

Please sign in to comment.