_cleanup()
{
- cd /
- echo $old_cow_lifetime > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime
- rm -rf $tmp.*
+ cd /
+ test -n "$old_cowgc_interval" && \
+ _xfs_set_cowgc_interval $old_cowgc_interval
+ rm -rf $tmp.*
}
# get standard environment, filters and checks
_require_xfs_io_command "falloc"
_require_xfs_io_command "fiemap"
-old_cow_lifetime=$(cat /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime)
+old_cowgc_interval=$(_xfs_get_cowgc_interval)
rm -f $seqres.full
md5sum $testdir/file2.chk | _filter_scratch
echo "CoW and leave leftovers"
-echo 2 > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime
+_xfs_set_cowgc_interval 2
seq 2 2 $((nr - 1)) | while read f; do
$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" $testdir/file2 >> $seqres.full
$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f - 1)) 1" $testdir/file2.chk >> $seqres.full
$XFS_IO_PROG -f -c "falloc 0 $filesize" $testdir/junk >> $seqres.full
echo "CoW and leave leftovers"
-echo $old_cow_lifetime > /proc/sys/fs/xfs/speculative_cow_prealloc_lifetime
+_xfs_set_cowgc_interval $old_cowgc_interval
seq 2 2 $((nr - 1)) | while read f; do
$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f)) 1" $testdir/file2 >> $seqres.full
$XFS_IO_PROG -f -c "pwrite -S 0x63 $((blksz * f)) 1" $testdir/file2.chk >> $seqres.full