zfs_copies.kshlib revision 1d32ba663e202c24a5a1f2e5aef83fffb447cb7f
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#
# Copyright (c) 2012, 2016 by Delphix. All rights reserved.
#
#
# Compare the value of copies property with specified value
# $1, the dataset name
# $2, the expected copies value
#
function cmp_prop
{
typeset ds=$1
typeset val_expect=$2
typeset val_actual
if [[ $val_actual != $val_expect ]]; then
"($val_actual)"
fi
}
#
# Get the value of property used via zfs list
# $1, the dataset name
#
function get_used_prop
{
typeset ds=$1
typeset used
if [[ $used == *K ]]; then
used=0
fi
echo $used
}
#
# Check the used space is charged correctly
# $1, the number of used space
# $2, the expected common factor between the used space and the file space
#
function check_used
{
typeset charged_spc=$1
typeset -i used
typeset -i expected_cfactor=$2
typeset -i cfactor
"copies as $expected_cfactor."
fi
}
#
# test ncopies on volume
# $1 test type zfs|ufs, default zfs
# $2 copies
# $3 mntp for ufs test
function do_vol_test
{
typeset type=$1
typeset copy=$2
typeset mntp=$3
log_must echo y | newfs $vol_r_path >/dev/null 2>&1
else
fi
else
fi
sleep 1
done
"copies as $copy"
fi
else
fi
}