From 18c39d907978ea787237754b79aab5ba3fa406bf Mon Sep 17 00:00:00 2001 From: braam Date: Tue, 21 Dec 1999 08:16:22 +0000 Subject: [PATCH] Numerous little changes: - HOWTO renamed and edited - Makefile: no inofs and other things taht don't work - Fixes to doc Makefile - obdcontrol a little clearer - switch to official MAJOR (186) --- lustre/include/linux/obd_class.h | 2 +- lustre/obdclass/obdcontrol | 20 ++++++-------------- lustre/obdclass/setup.sh | 5 +++++ 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/lustre/include/linux/obd_class.h b/lustre/include/linux/obd_class.h index 45816d6..ebda1dc 100644 --- a/lustre/include/linux/obd_class.h +++ b/lustre/include/linux/obd_class.h @@ -13,7 +13,7 @@ #include -#define OBD_PSDEV_MAJOR 120 +#define OBD_PSDEV_MAJOR 186 #define MAX_OBD_DEVICES 8 #define MAX_MULTI 16 diff --git a/lustre/obdclass/obdcontrol b/lustre/obdclass/obdcontrol index 9fd3972..379256e 100755 --- a/lustre/obdclass/obdcontrol +++ b/lustre/obdclass/obdcontrol @@ -91,7 +91,7 @@ use IO::Handle; my ($file); -GetOptions("f!" => \$file, "device=s" => \$::device, "fs=s" => $::filesystem) || die "Getoptions"; +GetOptions("f!" => \$file, "device=s" => \$::device, ) || die "Getoptions"; # get a console for the app @@ -147,7 +147,6 @@ my $term, $attribs; # Get going.... Device($::device); -Filesystem($::filesystem); sub readl { if ( $file ) { @@ -235,17 +234,6 @@ sub execute_line { return (&{$commands{$cmd}->{func}}(@arg)); } -# set the object store in the ext2 formatted block device -sub Filesystem { - my $filesystem = shift; - $filesystem = "/dev/loop0" unless $filesystem; - - $::filesystem = $filesystem; - 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 { @@ -272,6 +260,9 @@ sub Attach { my $data; my $datalen = 0; + if ( ! $type ) { + print "Usage \"attach type (ext2_obd)\"; + if ($type eq "obdscsi" ) { my $adapter = shift; my $bus = shift; @@ -696,7 +687,8 @@ sub Setup { if ( $type eq "ext2_obd" ) { my $dev = shift; - $dev = $::st->rdev() unless $dev; + my $st = stat($dev); + $dev = $st->rdev() unless $dev; $data = pack("i", $dev); $datalen = 4; } diff --git a/lustre/obdclass/setup.sh b/lustre/obdclass/setup.sh index b7c7041..723efe1 100755 --- a/lustre/obdclass/setup.sh +++ b/lustre/obdclass/setup.sh @@ -1,4 +1,9 @@ #! /bin/bash +if [ -f /tmp/fs ]; then + echo "/tmp/fs exists; I'm unwilling to overwrite it" + exit +fi + dd if=/dev/zero of=/tmp/fs bs=1k count=10k #insmod loop -- 1.8.3.1