Re: [PATCH 2/9 v5] common/rc: add _require_fiemap and _extent_hole_counts

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On Thu, Feb 05, 2015 at 10:37:06PM -0800, Jaegeuk Kim wrote:
> This is to detect whether fiemap tool supports or not.
> 
> For the follwoing tests, this patch adds general script to get extent and
> hole counts.
> 
>  xfs/137         (data vs filesize)
>  xfs/138         (data vs filesize vs truncate)
>  xfs/139         (data vs filesize vs partial truncate)
>  xfs/140         (data vs filesize vs extending truncate)
>  xfs/179         (data vs filesize w/ fsync)
>  xfs/180         (data vs filesize w/ sync)
>  xfs/182         (data vs filesize w/ recovery)
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
> ---
>  common/rc     | 13 +++++++++++++
>  tests/xfs/137 | 10 ++++++----
>  tests/xfs/138 | 10 ++++++----
>  tests/xfs/139 | 10 ++++++----
>  tests/xfs/140 |  6 ++++--
>  tests/xfs/179 |  6 ++++--
>  tests/xfs/180 |  6 ++++--
>  tests/xfs/182 |  6 ++++--
>  8 files changed, 47 insertions(+), 20 deletions(-)
> 
> diff --git a/common/rc b/common/rc
> index 234638b..078d3ca 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -2332,6 +2332,19 @@ _require_scratch_shutdown()
>  	_scratch_unmount
>  }
>  
> +# Does fiemap support?
> +_require_fiemap()
> +{
> +	_require_xfs_io_command "fiemap"
> +}
> +
> +_extent_hole_counts()
> +{
> +	res=`$XFS_IO_PROG -c "fiemap" $1 | tail -n +2`
> +	echo $res | grep -v hole | wc -l | $AWK_PROG '{print $1}'
> +	echo $res | grep hole | wc -l | $AWK_PROG '{print $1}'
> +}

Two functions - _count_extents() and _count_holes().

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux