defined(&OBD_SNAP_SETTABLE);
eval 'sub OBD_SNAP_PRINTTABLE () { &_IOC(3, ord(\'f\'), 41, 4);}' unless
defined(&OBD_SNAP_PRINTTABLE);
-
eval 'sub OBD_SNAP_DELETE() { &_IOC(3, ord(\'f\'), 42, 4);}' unless
defined(&OBD_SNAP_DELETE);
eval 'sub OBD_SNAP_RESTORE() { &_IOC(3, ord(\'f\'), 43, 4);}' unless
'create' => {func => "Create", doc => "create: creates a new inode"},
'attach' => {func => "Attach", doc => "attach type [adapter bus tid lun]"},
'detach' => {func => "Detach", doc => "detach this device"},
- 'snapattach' => {func => "SnapAttach", doc => "snapattach snapno table"},
+ 'testext2iterator' => {func => "TestExt2Iterator", doc => ""},
+ 'snapattach' => {func => "SnapAttach", doc => "snapattach snapdev snapidx tableno"},
'snapset' => {func => "SnapSetTable", doc => "snapset tableno file" },
'snapprint' => {func => "SnapPrint", doc => "snapprint tableno"},
-
- 'testext2iterator' => {func => "TestExt2Iterator", doc => ""},
'snapdelete' => {func => "SnapDelete", doc => "snapdelete: delete connected snap obd"},
'snaprestore' => {func => "SnapRestore", doc => "snaprestore: restore connected old snap to current"},
-
'snaptable' => {func => "SnapShotTable", doc => "snaptable: build a snapshot table (interactive)"},
'copy' => {func => "Copy", doc => "copy srcid tgtid"},
'migrate' => {func => "Migrate", doc => "migrate srcid tgtid"},
'format' => {func => "Format", doc => "format type adapter bus tid lun size"},
'partition' => {func => "Partition", doc => "partition type adapter bus tid lun partition size"},
- 'setup' => {func => "Setup", doc => "setup: link the ext2 partition (default /dev/loop0) to this obddev"},
+ 'setup' => {func => "Setup", doc => "setup [type]: link this OBD device to the underlying device (default type ext2_obd, filesystem /dev/loop0)"},
'connect' => {func => "Connect", doc => "connect: allocates client ID for this session"},
'disconnect' => {func => "Disconnect", doc => "disconnect [id]: frees client resources"},
'sync' => {func => "Sync", doc => "sync: flushes buffers to disk"},
- 'destroy' => {func => "Destroy", doc => "setup: destroys an inode"},
+ 'destroy' => {func => "Destroy", doc => "destroy <inode>: destroys an inode"},
'cleanup' => {func => "Cleanup", doc => "cleanup the minor obd device"},
'dec_use_count' => {func => "Decusecount", doc => "decreases the module use count so that the module can be removed following an oops"},
'read' => {func => "Read", doc => "read <inode> <count> [offset]"},
if (!defined($::st = stat($filesystem))) {
die "Unable to stat $filesystem.\n";
}
+ print "Filesystem now $filesystem\n";
}
# select the OBD device we talk to
sub Device {
my $device = shift;
+ if ($::client_id) {
+ print "Disconnecting active session ($::client_id)...";
+ Disconnect($::client_id);
+ }
if (! $device ) {
$device = "/dev/obd0";
}
sub TestExt2Iterator {
+ if (!defined($::client_id)) {
+ print "You must first ``connect''.\n";
+ return;
+ }
+
my $err = 0;
my $type = "ext2_obd";
sub SnapDelete {
+ if (!defined($::client_id)) {
+ print "You must first ``connect''.\n";
+ return;
+ }
+
my $err = 0;
my $type = "snap_obd";
}
+# FIXME the parameter to snaprestore SHOULD be the snapshot number of the
+# snapshot to be restored, and this routine should handle all of the
+# removal of intervening snapshots and changing the snaptable to have
+# the "restored" snapshot as current and move the previous current.
sub SnapRestore {
+ if (!defined($::client_id)) {
+ print "You must first ``connect''.\n";
+ return;
+ }
+
my $err = 0;
my $type = "snap_obd";
my $prevcurrent = shift;
my $err = 0;
my $type = "snap_obd";
my $snapdev = shift;
- my $snapno = shift;
+ my $snapidx = shift;
my $tableno = shift;
my $snapcount;
my $data;
my $datalen = 0;
- $data = pack("iii", $snapdev, $snapno, $tableno);
+ $data = pack("iii", $snapdev, $snapidx, $tableno);
$datalen = 3 * 4;
my $len = length($type);
+--- linux/include/linux/fs.h.org Tue Oct 12 10:39:59 1999
++++ linux/include/linux/fs.h Tue Oct 12 11:32:46 1999
+@@ -934,6 +934,8 @@
+
+
+ extern struct super_block *get_super(kdev_t);
++struct super_block *get_empty_super(void);
++void remove_vfsmnt(kdev_t dev);
+ extern void put_super(kdev_t);
+ unsigned long generate_cluster(kdev_t, int b[], int);
+ unsigned long generate_cluster_swab32(kdev_t, int b[], int);
+--- linux/fs/super.c.org Tue Oct 12 10:39:05 1999
++++ linux/fs/super.c Tue Oct 12 11:18:14 1999
+@@ -135,7 +135,7 @@
+ return lptr;
+ }
+
+-static void remove_vfsmnt(kdev_t dev)
++void remove_vfsmnt(kdev_t dev)
+ {
+ struct vfsmount *lptr, *tofree;
+
+@@ -508,7 +508,7 @@
+ /*
+ * Find a super_block with no device assigned.
+ */
+-static struct super_block *get_empty_super(void)
++struct super_block *get_empty_super(void)
+ {
+ struct super_block *s;
+
--- linux/kernel/ksyms.c.or Tue Oct 12 10:40:21 1999
+++ linux/kernel/ksyms.c Tue Oct 12 11:22:45 1999
@@ -36,6 +36,7 @@
EXPORT_SYMBOL(get_empty_filp);
EXPORT_SYMBOL(init_private_file);
EXPORT_SYMBOL(filp_open);
---- linux/fs/super.c.or Tue Oct 12 10:39:05 1999
-+++ linux/fs/super.c Tue Oct 12 11:18:14 1999
-@@ -135,7 +135,7 @@
- return lptr;
- }
-
--static void remove_vfsmnt(kdev_t dev)
-+void remove_vfsmnt(kdev_t dev)
- {
- struct vfsmount *lptr, *tofree;
-
-@@ -508,7 +508,7 @@
- /*
- * Find a super_block with no device assigned.
- */
--static struct super_block *get_empty_super(void)
-+struct super_block *get_empty_super(void)
- {
- struct super_block *s;
-
---- linux/include/linux/fs.h.or Tue Oct 12 10:39:59 1999
-+++ linux/include/linux/fs.h Tue Oct 12 11:32:46 1999
-@@ -934,6 +934,8 @@
-
-
- extern struct super_block *get_super(kdev_t);
-+struct super_block *get_empty_super(void);
-+void remove_vfsmnt(kdev_t dev);
- extern void put_super(kdev_t);
- unsigned long generate_cluster(kdev_t, int b[], int);
- unsigned long generate_cluster_swab32(kdev_t, int b[], int);