summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Koerfgen <hkoerfg@web.de>1999-04-12 20:50:49 +0000
committerHarald Koerfgen <hkoerfg@web.de>1999-04-12 20:50:49 +0000
commitd6509c7221656060ff995b645dfc1eac582c7f31 (patch)
tree2fd525281d4f0c7c6b828775163aecfb80c0b4af
parent7be6c2b5c3a6cffb5eb811a88a57b77cfb8a06dd (diff)
Linux/MIPS understands NetBSD/pmax and Ultrix partition tables
-rw-r--r--drivers/block/genhd.c55
-rw-r--r--fs/Config.in3
2 files changed, 58 insertions, 0 deletions
diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c
index ec5453979..68201da87 100644
--- a/drivers/block/genhd.c
+++ b/drivers/block/genhd.c
@@ -663,12 +663,16 @@ static int osf_partition(struct gendisk *hd, unsigned int dev, unsigned long fir
label = (struct disklabel *) (bh->b_data+64);
partition = label->d_partitions;
if (label->d_magic != DISKLABELMAGIC) {
+#ifndef CONFIG_DECSTATION
printk("magic: %08x\n", label->d_magic);
+#endif
brelse(bh);
return 0;
}
if (label->d_magic2 != DISKLABELMAGIC) {
+#ifndef CONFIG_DECSTATION
printk("magic2: %08x\n", label->d_magic2);
+#endif
brelse(bh);
return 0;
}
@@ -1182,6 +1186,53 @@ static int atari_partition (struct gendisk *hd, kdev_t dev,
}
#endif /* CONFIG_ATARI_PARTITION */
+#ifdef CONFIG_ULTRIX_PARTITION
+
+static int ultrix_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector)
+{
+ int i, minor = current_minor;
+ struct buffer_head *bh;
+ struct ultrix_disklabel {
+ long pt_magic; /* magic no. indicating part. info exits */
+ int pt_valid; /* set by driver if pt is current */
+ struct pt_info {
+ int pi_nblocks; /* no. of sectors */
+ unsigned long pi_blkoff; /* block offset for start */
+ } pt_part[8];
+ } *label;
+
+#define PT_MAGIC 0x032957 /* Partition magic number */
+#define PT_VALID 1 /* Indicates if struct is valid */
+
+#define SBLOCK ((unsigned long)((16384 - sizeof(struct ultrix_disklabel)) \
+ /get_ptable_blocksize(dev)))
+
+ bh = bread (dev, SBLOCK, get_ptable_blocksize(dev));
+ if (!bh) {
+ printk (" unable to read block 0x%lx\n", SBLOCK);
+ return -1;
+ }
+
+ label = (struct ultrix_disklabel *)(bh->b_data
+ + get_ptable_blocksize(dev)
+ - sizeof(struct ultrix_disklabel));
+
+ if (label->pt_magic == PT_MAGIC && label->pt_valid == PT_VALID) {
+ for (i=0; i<8; i++, minor++)
+ if (label->pt_part[i].pi_nblocks)
+ add_partition(hd, minor,
+ label->pt_part[i].pi_blkoff,
+ label->pt_part[i].pi_nblocks);
+ brelse(bh);
+ return 1;
+ } else {
+ brelse(bh);
+ return 0;
+ }
+}
+
+#endif /* CONFIG_ULTRIX_PARTITION */
+
static void check_partition(struct gendisk *hd, kdev_t dev)
{
static int first_time = 1;
@@ -1231,6 +1282,10 @@ static void check_partition(struct gendisk *hd, kdev_t dev)
if(sgi_partition(hd, dev, first_sector))
return;
#endif
+#ifdef CONFIG_ULTRIX_PARTITION
+ if(ultrix_partition(hd, dev, first_sector))
+ return;
+#endif
printk(" unknown partition table\n");
}
diff --git a/fs/Config.in b/fs/Config.in
index 216e7bf46..1fdf8acd7 100644
--- a/fs/Config.in
+++ b/fs/Config.in
@@ -114,11 +114,14 @@ comment 'Partition Types'
bool 'BSD disklabel (BSD partition tables) support' CONFIG_BSD_DISKLABEL
bool 'Macintosh partition map support' CONFIG_MAC_PARTITION
+bool 'OSF partition table support' CONFIG_OSF_PARTITION
bool 'SMD disklabel (Sun partition tables) support' CONFIG_SMD_DISKLABEL
bool 'Solaris (x86) partition table support' CONFIG_SOLARIS_X86_PARTITION
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ bool 'Ultrix partition table support (experimental)' CONFIG_ULTRIX_PARTITION
bool 'Unixware slices support (EXPERIMENTAL)' CONFIG_UNIXWARE_DISKLABEL
fi
+
endmenu
source fs/nls/Config.in