Re: [PATCH] xfstests: very basic defragmentation testing for xfs & ext4

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

 



On Wed, Jul 15, 2009 at 03:21:11PM -0500, Eric Sandeen wrote:
> Test a few very basic defragmentation scenarios.
> 
> This test creates some files, runs defrag on them,
> and compares the before/after fragmentation as well
> as file md5sums and timestamps.
> 
> (md5sums may just be reading buffered data though,
> suggestions?)

As Andreas said unmount it before.

> The test currently expects to find e4defrag in
> /usr/bin

> +_supported_fs xfs ext4

> +fragfile=$SCRATCH_MNT/fragfile.$$
> +
> +if [ "$FSTYP" == "xfs" ]; then
> +	DEFRAG=/usr/sbin/xfs_fsr
> +else
> +	DEFRAG=/usr/bin/e4defrag
> +fi
> +
> +_require_command $DEFRAG
> +_require_command /usr/sbin/filefrag

I think we're much better off adding a helpers for this in a new
common.defrag (or adding it somwhere).

Then set a DEFRAF_PROG variable there, and add a _require_defrag
ala

_require_defrag()
{
    case "$FSTYP" in
    xfs)
        DEFRAG_PROG=/usr/sbin/xfs_fsr
	;;
    ext4)
        DEFRAG_PROG=/usr/bin/e4defrag
	;;
    *)
        _notrun "defragmentation not supported for fstype \"$FSTYP\""
	;;
    esac

    _require_command $DEFRAG
    _require_command /usr/sbin/filefrag
}

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

[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux