remove EXT2_UNDEL_DIR_INO from list of iterated inodes.
class/obdcontrol: after snaprestore remove snapshot from table by key not index
15 files changed:
#!/bin/sh
# Script to remove the loopback device and temp file created in newtest.sh
OBDDIR="`dirname $0`/.."
#!/bin/sh
# Script to remove the loopback device and temp file created in newtest.sh
OBDDIR="`dirname $0`/.."
-
-[ "$OBDDIR" = "./.." ] && OBDDIR=".."
-
. $OBDDIR/demos/config.sh
. $OBDDIR/demos/config.sh
-mount | grep $MNTOBD > /dev/null 2>&1
-if [ x$? = x0 ]; then
+mount | grep "$MNTOBD " > /dev/null 2>&1
+if [ x$? = x0 ]; then
echo "Stuff still mounted on $MNTOBD"
echo "Stuff still mounted on $MNTOBD"
-mount | grep $MNTSNAP > /dev/null 2>&1
-if [ x$? = x0 ]; then
+mount | grep "$MNTSNAP " > /dev/null 2>&1
+if [ x$? = x0 ]; then
echo "Stuff still mounted on $MNTSNAP"
echo "Stuff still mounted on $MNTSNAP"
-mount | grep $MNTSNAP > /dev/null 2>&1
-if [ x$? = x0 ]; then
+mount | grep "$MNTSNAP2 " > /dev/null 2>&1
+if [ x$? = x0 ]; then
echo "Stuff still mounted on $MNTSNAP2"
echo "Stuff still mounted on $MNTSNAP2"
#! /bin/sh
# Get the locations for the files from a single place to avoid confusion
OBDDIR="`dirname $0`/.."
#! /bin/sh
# Get the locations for the files from a single place to avoid confusion
OBDDIR="`dirname $0`/.."
-[ "$OBDDIR" = "./.." ] && OBDDIR=".."
# source config info
. $OBDDIR/demos/config.sh
# source config info
. $OBDDIR/demos/config.sh
echo "You need to clean up $LOOPDEV (via cleanup.sh),"
echo "or you can change which device is used in demos/config.sh" 1>&2
# undo previous
echo "You need to clean up $LOOPDEV (via cleanup.sh),"
echo "or you can change which device is used in demos/config.sh" 1>&2
# undo previous
+ [ "$TMPFILE" ] && rm $TMPFILE
else
echo "\$BASEDEV not defined in demos/config.sh. Please fix!"
[ "$LOOPDEV" ] && losetup -d $LOOPDEV
else
echo "\$BASEDEV not defined in demos/config.sh. Please fix!"
[ "$LOOPDEV" ] && losetup -d $LOOPDEV
+ [ "$TMPFILE" ] && rm $TMPFILE
#!/bin/sh
# Utility script for cleaning up a simple OBDFS mounted filesystem
OBDDIR="`dirname $0`/.."
#!/bin/sh
# Utility script for cleaning up a simple OBDFS mounted filesystem
OBDDIR="`dirname $0`/.."
. $OBDDIR/demos/config.sh
umount $MNTOBD
. $OBDDIR/demos/config.sh
umount $MNTOBD
#! /bin/bash
# Utility script for configuring a simple OBDFS mount
#! /bin/bash
# Utility script for configuring a simple OBDFS mount
-[ "$OBDDIR" = "./.." ] && OBDDIR=".."
-
. $OBDDIR/demos/config.sh
$OBDDIR/demos/basesetup.sh
. $OBDDIR/demos/config.sh
$OBDDIR/demos/basesetup.sh
# not already mounted on /mnt/obd, we call the basic OBD setup script to
# create and mount a filesystem for us.
OBDDIR="`dirname $0`/.."
# not already mounted on /mnt/obd, we call the basic OBD setup script to
# create and mount a filesystem for us.
OBDDIR="`dirname $0`/.."
-[ "$OBDDIR" = "" ] && OBDDIR=".."
. $OBDDIR/demos/config.sh
[ ! -d $MNTOBD/lost+found ] && $OBDDIR/demos/obdfssetup.sh
. $OBDDIR/demos/config.sh
[ ! -d $MNTOBD/lost+found ] && $OBDDIR/demos/obdfssetup.sh
#!/bin/sh
# Utility script for cleaning up a third snapshot created by setup3.sh
OBDDIR="`dirname $0`/.."
#!/bin/sh
# Utility script for cleaning up a third snapshot created by setup3.sh
OBDDIR="`dirname $0`/.."
-[ "$OBDDIR" = "" ] && OBDDIR=".."
. $OBDDIR/demos/config.sh
plog umount $MNTSNAP2
. $OBDDIR/demos/config.sh
plog umount $MNTSNAP2
#!/bin/sh
# Utility script for creating a third snapshot.
OBDDIR="`dirname $0`/.."
#!/bin/sh
# Utility script for creating a third snapshot.
OBDDIR="`dirname $0`/.."
-[ "$OBDDIR" = "" ] && OBDDIR=".."
. $OBDDIR/demos/config.sh
[ ! -d $MNTSNAP/lost+found ] && $OBDDIR/demos/snapsetup.sh
. $OBDDIR/demos/config.sh
[ ! -d $MNTSNAP/lost+found ] && $OBDDIR/demos/snapsetup.sh
#! /bin/bash
# Utility script for cleaning up snapshots and removing modules.
OBDDIR="`dirname $0`/.."
#! /bin/bash
# Utility script for cleaning up snapshots and removing modules.
OBDDIR="`dirname $0`/.."
-[ "$OBDDIR" = "" ] && OBDDIR=".."
. $OBDDIR/demos/config.sh
plog umount $MNTOBD
. $OBDDIR/demos/config.sh
plog umount $MNTOBD
$OBDDIR/demos/obdfsclean.sh
$OBDDIR/demos/obdfsclean.sh
# Utility script to test deleting a snapshot that has been previously
# created as the setup.sh script does.
OBDDIR="`dirname $0`/.."
# Utility script to test deleting a snapshot that has been previously
# created as the setup.sh script does.
OBDDIR="`dirname $0`/.."
-[ "$OBDDIR" = "" ] && OBDDIR=".."
. $OBDDIR/demos/config.sh
[ ! -d $MNTSNAP/lost+found ] && echo "need to run obdsetup.sh first" && exit 1
. $OBDDIR/demos/config.sh
[ ! -d $MNTSNAP/lost+found ] && echo "need to run obdsetup.sh first" && exit 1
# Utility script to test restoring a previous snapshot. This will destroy
# the "current" snapshot and restore the old one in its place.
OBDDIR="`dirname $0`/.."
# Utility script to test restoring a previous snapshot. This will destroy
# the "current" snapshot and restore the old one in its place.
OBDDIR="`dirname $0`/.."
-[ "$OBDDIR" = "./.." ] && OBDDIR=".."
. $OBDDIR/demos/config.sh
[ ! -d $MNTSNAP/lost+found ] && echo "need to run snapsetup.sh first" && exit 1
. $OBDDIR/demos/config.sh
[ ! -d $MNTSNAP/lost+found ] && echo "need to run snapsetup.sh first" && exit 1
plog umount $MNTSNAP
plog umount $MNTOBD
plog umount $MNTSNAP
plog umount $MNTOBD
-mount | grep $MNTOBD > /dev/null 2>&1
+mount | grep "$MNTOBD " > /dev/null 2>&1
if [ x$? = x0 ]; then
echo "Stuff still mounted on $MNTOBD; clean up first."
exit
fi
if [ x$? = x0 ]; then
echo "Stuff still mounted on $MNTOBD; clean up first."
exit
fi
-mount | grep $MNTSNAP > /dev/null 2>&1
+mount | grep "$MNTSNAP " > /dev/null 2>&1
if [ x$? = x0 ]; then
echo "Stuff still mounted on $MNTSNAP; clean up first."
exit
if [ x$? = x0 ]; then
echo "Stuff still mounted on $MNTSNAP; clean up first."
exit
#! /bin/bash
# Utility script for cleaning up a simple OBDFS mounted filesystem
OBDDIR="`dirname $0`/.."
#! /bin/bash
# Utility script for cleaning up a simple OBDFS mounted filesystem
OBDDIR="`dirname $0`/.."
. $OBDDIR/demos/config.sh
umount $MNTOBD
. $OBDDIR/demos/config.sh
umount $MNTOBD
-mount | grep $MNTOBD > /dev/null 2>&1
+mount | grep "$MNTOBD " > /dev/null 2>&1
if [ x$? = x0 ]; then
echo "Stuff still mounted on $MNTOBD; clean up first."
exit
fi
if [ x$? = x0 ]; then
echo "Stuff still mounted on $MNTOBD; clean up first."
exit
fi
$OBDDIR/class/obdcontrol -f << EOF
device /dev/obd2
cleanup
$OBDDIR/class/obdcontrol -f << EOF
device /dev/obd2
cleanup
rmmod obdsnap
rmmod obdext2
rmmod obdclass
rmmod obdsnap
rmmod obdext2
rmmod obdclass
$OBDDIR/demos/baseclean.sh
$OBDDIR/demos/baseclean.sh
# not already mounted on /mnt/obd, we call the basic OBD setup script to
# create and mount a filesystem for us.
OBDDIR="`dirname $0`/.."
# not already mounted on /mnt/obd, we call the basic OBD setup script to
# create and mount a filesystem for us.
OBDDIR="`dirname $0`/.."
. $OBDDIR/demos/config.sh
# prepare the snapshot drive with a file to be COW'd
. $OBDDIR/demos/config.sh
# prepare the snapshot drive with a file to be COW'd
-
-mount | grep $MNTOBD > /dev/null 2>&1
+mount | grep "$MNTOBD " > /dev/null 2>&1
if [ x$? = x0 ]; then
echo "Stuff still mounted on $MNTOBD; clean up first."
exit
if [ x$? = x0 ]; then
echo "Stuff still mounted on $MNTOBD; clean up first."
exit
# Utility script to perform minor modifications to the read-write mounted
# snapshot in order to demonstrate the changes w.r.t. the read-only snapshot
OBDDIR="`dirname $0`/.."
# Utility script to perform minor modifications to the read-write mounted
# snapshot in order to demonstrate the changes w.r.t. the read-only snapshot
OBDDIR="`dirname $0`/.."
-[ "$OBDDIR" = "" ] && OBDDIR=".."
. $OBDDIR/demos/config.sh
plog chmod 777 $MNTOBD # change attributes on an existing file
. $OBDDIR/demos/config.sh
plog chmod 777 $MNTOBD # change attributes on an existing file
return -ENODEV;
fsync_dev(inode->i_rdev);
if (obd_dev[dev].obd_refcnt <= 0)
return -ENODEV;
fsync_dev(inode->i_rdev);
if (obd_dev[dev].obd_refcnt <= 0)
- printk(KERN_ALERT "presto_psdev_release: refcount(%d) <= 0\n",
+ printk(KERN_ALERT "obd_class_release: refcount(%d) <= 0\n",
obd_dev[dev].obd_refcnt);
obd_dev[dev].obd_refcnt--;
obd_dev[dev].obd_refcnt);
obd_dev[dev].obd_refcnt--;
my $restoreto = shift;
my $snaptable = shift;
my $tableno = shift;
my $restoreto = shift;
my $snaptable = shift;
my $tableno = shift;
# don't do anything until connected
if (!defined($::client_id)) {
# don't do anything until connected
if (!defined($::client_id)) {
}
my $table = ReadSnapShotTable($snaptable);
}
my $table = ReadSnapShotTable($snaptable);
- $key = FindSnapInTable($table, $restoreto);
- if ( ! defined $table->{0} || ! defined $key ) {
+ $restoretime = FindSnapInTable($table, $restoreto);
+ if ( ! defined $table->{0} || ! defined $restoretime ) {
PrintSnapShotTable($table);
print "No current or $restoreto slot in this table\n";
return;
}
my $currentindex = $table->{0};
PrintSnapShotTable($table);
print "No current or $restoreto slot in this table\n";
return;
}
my $currentindex = $table->{0};
- if ( $table->{$key} == $currentindex ) {
+ if ( $table->{$restoretime} == $currentindex ) {
print "You should not restore to the current snapshot\n";
return;
}
# swap the entries for 0 and $restoreto
print "You should not restore to the current snapshot\n";
return;
}
# swap the entries for 0 and $restoreto
- my $tmp = $table->{$key};
- $table->{$key} = $table->{0};
+ my $tmp = $table->{$restoretime};
+ $table->{$restoretime} = $table->{0};
- PrintSnapShotTable($table);
+ # PrintSnapShotTable($table);
# write it back
WriteSnapShotTable($snaptable, $table);
# write it back
WriteSnapShotTable($snaptable, $table);
print STDERR "ioctl failed: $!\n";
} elsif ($rc eq "0 but true") {
print "Snaprestore finished (success)\n";
print STDERR "ioctl failed: $!\n";
} elsif ($rc eq "0 but true") {
print "Snaprestore finished (success)\n";
- delete $table->{$restoreto};
+ delete $table->{$restoretime} if defined $restoretime;
# write it back
WriteSnapShotTable($snaptable, $table);
# set it in the kernel
SnapSetTable($tableno, $snaptable);
# write it back
WriteSnapShotTable($snaptable, $table);
# set it in the kernel
SnapSetTable($tableno, $snaptable);
- PrintSnapShotTable($table);
+ # PrintSnapShotTable($table);
} else {
print "ioctl returned error code $rc.\n";
} else {
print "ioctl returned error code $rc.\n";
my $table = shift;
my $snapno =shift;
my $table = shift;
my $snapno =shift;
- foreach my $key ( keys %{$table} ) {
- if ( $table->{$key} == $snapno) {
- print "Found key $key for snapno $snapno\n";
- return $key;
+ foreach my $restoretime ( keys %{$table} ) {
+ if ( $table->{$restoretime} == $snapno) {
+ print "Found key $restoretime for snapno $snapno\n";
+ return $restoretime;