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 <jaeg...@kernel.org>
> ---
>  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
da...@fromorbit.com

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to