Skip to content

Commit

Permalink
Set refquota on when fssize provided
Browse files Browse the repository at this point in the history
When a filesystem of a specific size is requested the the refquota.
This is going to be an artificial limit since zfs uses pooled storage
but that can be helpful when running tests which are designed to fill
the entire filesystem.

Additionally, update the scratch fs creation to first destroy the
previous dataset and then create a new one.
  • Loading branch information
behlendorf committed Jul 25, 2011
1 parent 0b8d051 commit 36f86a8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions common.rc
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,10 @@ _scratch_mkfs()
zfs)
# SCRATCH_DEV must be of the form 'pool/dataset'
/sbin/zfs list -H $SCRATCH_DEV > /dev/null 2>&1
if [ "$?" != "0" ]; then
/sbin/zfs create -o mountpoint=legacy $SCRATCH_DEV
if [ "$?" = "0" ]; then
/sbin/zfs destroy -f $SCRATCH_DEV
fi
/sbin/zfs create -o mountpoint=legacy $SCRATCH_DEV
;;
*)
/sbin/mkfs -t $FSTYP -- $MKFS_OPTIONS $* $SCRATCH_DEV
Expand Down Expand Up @@ -343,12 +344,12 @@ _scratch_mkfs_sized()
/sbin/mkfs.$FSTYP $MKFS_OPTIONS $SCRATCH_DEV -b $fssize
;;
zfs)
# No size required due to the nature of pooled storage
# SCRATCH_DEV must be of the form 'pool/dataset'
/sbin/zfs list -H $SCRATCH_DEV > /dev/null 2>&1
if [ "$?" != "0" ]; then
/sbin/zfs create -o mountpoint=legacy $SCRATCH_DEV
if [ "$?" = "0" ]; then
/sbin/zfs destroy -f $SCRATCH_DEV
fi
/sbin/zfs create -o mountpoint=legacy -o refquota=$fssize $SCRATCH_DEV
;;
*)
_notrun "Filesystem $FSTYP not supported in _scratch_mkfs_sized"
Expand Down

0 comments on commit 36f86a8

Please sign in to comment.