LOWER_DIR=/n/lower
TMP_DIR=/n/tmp
-# TODO: define TMP_DIR, SCRATCH_DIR, and LOWER_DIR, and don't hardcode them below
-# TODO: TMP_DIR shoyld be /n/tmp, ensure to "runcmd mkdir -p $TMP_DIR"
-
function runcmd
{
echo "CMD: $@"
runcmd exportfs -u localhost:$LOWER_DIR
runcmd umount $LOWER_DIR
;;
+ wrapfs )
+ runcmd lsof $LOWER_DIR
+ runcmd umount $LOWER_DIR
+ runcmd lsof $SCRATCH_DIR
+ runcmd umount $SCRATCH_DIR
esac
}
+dirs="$TMP_DIR $LOWER_DIR $SCRATCH_DIR"
+for d in $dirs; do
+ if cat /proc/mounts | grep $d; then
+ runcmd umount $d
+ fi
+done
+
# decide what type of test
type="bind" # default
case "$1" in
-d | -direct ) type="direct" ; shift ;;
esac
case "$1" in
- ext3 | ext2 | ext4 | reiserfs | xfs | tmpfs | nfs ) lowertype=$1 ;;
+ ext3 | ext2 | ext4 | reiserfs | xfs | tmpfs | nfs | wrapfs ) lowertype=$1 ;;
* )
echo "Usage: $0 '[-w(rapfs) | -d(irect)] LOWERTYPE [duration (60 sec default)]'"
- echo "where LOWERTYPE is one of: ext[234] reiserfs xfs tmpfs nfs"
+ echo "where LOWERTYPE is one of: ext[234] reiserfs xfs tmpfs nfs wrapfs"
echo "-d will run racer directly on lower fs mount"
echo "if neither -w nor -d is specified, racer will run through a bind mount"
exit 1
runcmd mount -t $lowertype -o size=3000m tmpfs $SCRATCH_DIR
;;
nfs )
- runcmd mkdir -p $LOWER_DIR
runcmd mkfs -t ext3 -q $SCRATCH_DEV <<< y
runcmd mount -t ext3 $SCRATCH_DEV $LOWER_DIR
runcmd exportfs -o no_root_squash,rw localhost:$LOWER_DIR
runcmd mount -t $lowertype localhost:$LOWER_DIR $SCRATCH_DIR
;;
+ wrapfs )
+ runcmd mkfs -t ext4 -q $SCRATCH_DEV <<< y
+ runcmd mount -t ext4 $SCRATCH_DEV $LOWER_DIR
+ runcmd mount -t $lowertype $LOWER_DIR $SCRATCH_DIR
esac
case "$type" in
wrapfs )