summaryrefslogtreecommitdiffstats
path: root/fs/partitions
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-02-18 00:24:27 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-02-18 00:24:27 +0000
commitb9558d5f86c471a125abf1fb3a3882fb053b1f8c (patch)
tree707b53ec64e740a7da87d5f36485e3cd9b1c794e /fs/partitions
parentb3ac367c7a3e6047abe74817db27e34e759f279f (diff)
Merge with Linux 2.3.41.
Diffstat (limited to 'fs/partitions')
-rw-r--r--fs/partitions/Config.in27
-rw-r--r--fs/partitions/check.c1
-rw-r--r--fs/partitions/sgi.c8
-rw-r--r--fs/partitions/sun.c6
-rw-r--r--fs/partitions/ultrix.c27
-rw-r--r--fs/partitions/ultrix.h10
6 files changed, 39 insertions, 40 deletions
diff --git a/fs/partitions/Config.in b/fs/partitions/Config.in
index 57706a744..6974e1a2d 100644
--- a/fs/partitions/Config.in
+++ b/fs/partitions/Config.in
@@ -21,7 +21,9 @@ if [ "$CONFIG_PARTITION_ADVANCED" = "y" ]; then
bool ' Solaris (x86) partition table support' CONFIG_SOLARIS_X86_PARTITION
bool ' Unixware slices support' CONFIG_UNIXWARE_DISKLABEL
fi
- bool ' Ultrix partition table support' CONFIG_ULTRIX_PARTITION
+ bool 'SGI partition support' CONFIG_SGI_PARTITION
+ bool 'Ultrix partition table support' CONFIG_ULTRIX_PARTITION
+ bool 'Sun partition tables support' CONFIG_SUN_PARTITION
else
if [ "$ARCH" = "alpha" ]; then
define_bool CONFIG_OSF_PARTITION y
@@ -30,7 +32,8 @@ else
define_bool CONFIG_MAC_PARTITION y
fi
if [ "$CONFIG_AMIGA" != "y" -a "$CONFIG_ATARI" != "y" -a \
- "$CONFIG_MAC" != "y" ]; then
+ "$CONFIG_MAC" != "y" -a "$CONFIG_SGI_IP22" != "y" -a \
+ "$CONFIG_SGI_IP27" != "y" ]; then
define_bool CONFIG_MSDOS_PARTITION y
fi
if [ "$CONFIG_AMIGA" = "y" ]; then
@@ -47,15 +50,13 @@ else
if [ "$CONFIG_ATARI" = "y" ]; then
define_bool CONFIG_ATARI_PARTITION y
fi
- bool 'Ultrix partition table support' CONFIG_ULTRIX_PARTITION
-fi
-if [ "$CONFIG_SGI_IP22" != "y" -a "$CONFIG_SGI_IP27" != "y" ]; then
- bool 'SGI partition support' CONFIG_SGI_PARTITION
-else
- define_bool CONFIG_SGI_PARTITION y
-fi
-if [ "$ARCH" != "sparc" -a "$ARCH" != "sparc64" ]; then
- bool 'Sun partition tables support' CONFIG_SUN_PARTITION
-else
- define_bool CONFIG_SUN_PARTITION y
+ if [ "$CONFIG_SGI_IP22" = "y" -o "$CONFIG_SGI_IP27" = "y" ]; then
+ define_bool CONFIG_SGI_PARTITION y
+ fi
+ if [ "$CONFIG_DECSTATION" = "y" ]; then
+ define_bool CONFIG_ULTRIX_PARTITION y
+ fi
+ if [ "$ARCH" = "sparc" -o "$ARCH" = "sparc64" ]; then
+ define_bool CONFIG_SUN_PARTITION y
+ fi
fi
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index ec0bd3a4b..d9c4c11de 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -277,7 +277,6 @@ static void check_partition(struct gendisk *hd, kdev_t dev, int first_part_minor
void register_disk(struct gendisk *gdev, kdev_t dev, unsigned minors,
struct block_device_operations *ops, long size)
{
- unsigned first = (unsigned)dev;
if (!gdev)
return;
grok_partitions(gdev, MINOR(dev)>>gdev->minor_shift, minors, size);
diff --git a/fs/partitions/sgi.c b/fs/partitions/sgi.c
index 8ae97eca0..db9c1ae39 100644
--- a/fs/partitions/sgi.c
+++ b/fs/partitions/sgi.c
@@ -44,15 +44,15 @@ int sgi_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector, in
struct sgi_partition *p;
if(!(bh = bread(dev, 0, get_ptable_blocksize(dev)))) {
- printk("Dev %s: unable to read partition table\n", kdevname(dev));
+ printk(KERN_WARNING "Dev %s: unable to read partition table\n", kdevname(dev));
return -1;
}
label = (struct sgi_disklabel *) bh->b_data;
p = &label->partitions[0];
magic = label->magic_mushroom;
if(be32_to_cpu(magic) != SGI_LABEL_MAGIC) {
- printk("Dev %s SGI disklabel: bad magic %08x\n",
- kdevname(dev), magic);
+ /*printk("Dev %s SGI disklabel: bad magic %08x\n",
+ kdevname(dev), magic);*/
brelse(bh);
return 0;
}
@@ -62,7 +62,7 @@ int sgi_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector, in
csum += be32_to_cpu(cs);
}
if(csum) {
- printk("Dev %s SGI disklabel: csum bad, label corrupted\n",
+ printk(KERN_WARNING "Dev %s SGI disklabel: csum bad, label corrupted\n",
kdevname(dev));
brelse(bh);
return 0;
diff --git a/fs/partitions/sun.c b/fs/partitions/sun.c
index 5d82a70c6..5f31cde4b 100644
--- a/fs/partitions/sun.c
+++ b/fs/partitions/sun.c
@@ -48,15 +48,15 @@ int sun_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector, in
unsigned long spc;
if(!(bh = bread(dev, 0, get_ptable_blocksize(dev)))) {
- printk("Dev %s: unable to read partition table\n",
+ printk(KERN_WARNING "Dev %s: unable to read partition table\n",
kdevname(dev));
return -1;
}
label = (struct sun_disklabel *) bh->b_data;
p = label->partitions;
if (be16_to_cpu(label->magic) != SUN_LABEL_MAGIC) {
- printk("Dev %s Sun disklabel: bad magic %04x\n",
- kdevname(dev), be16_to_cpu(label->magic));
+/* printk(KERN_INFO "Dev %s Sun disklabel: bad magic %04x\n",
+ kdevname(dev), be16_to_cpu(label->magic)); */
brelse(bh);
return 0;
}
diff --git a/fs/partitions/ultrix.c b/fs/partitions/ultrix.c
index 1de4d04b0..654a4fbd1 100644
--- a/fs/partitions/ultrix.c
+++ b/fs/partitions/ultrix.c
@@ -13,11 +13,11 @@
#include <linux/blk.h>
#include "check.h"
-#include "ultrix.h"
-int ultrix_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector, int first_part_minor)
+static int ultrix_partition(struct gendisk *hd, kdev_t dev,
+ unsigned long first_sector, int curren_minor)
{
- int i;
+ int i, minor = current_minor;
struct buffer_head *bh;
struct ultrix_disklabel {
s32 pt_magic; /* magic no. indicating part. info exits */
@@ -28,6 +28,12 @@ int ultrix_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector,
} 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);
@@ -38,14 +44,12 @@ int ultrix_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector,
+ get_ptable_blocksize(dev)
- sizeof(struct ultrix_disklabel));
- if (le32_to_cpu(label->pt_magic) == PT_MAGIC &&
- le32_to_cpu(label->pt_valid == PT_VALID)) {
- for (i=0; i<8; i++, first_part_minor++)
- if (le32_to_cpu(label->pt_part[i].pi_nblocks))
- add_gd_partition(hd, first_part_minor,
- le32_to_cpu(label->pt_part[i].pi_blkoff),
- le32_to_cpu(label->pt_part[i].pi_nblocks));
-
+ 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_gd_partition(hd, minor,
+ label->pt_part[i].pi_blkoff,
+ label->pt_part[i].pi_nblocks);
brelse(bh);
printk ("\n");
return 1;
@@ -54,4 +58,3 @@ int ultrix_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector,
return 0;
}
}
-
diff --git a/fs/partitions/ultrix.h b/fs/partitions/ultrix.h
index b2d24fdfd..385a32590 100644
--- a/fs/partitions/ultrix.h
+++ b/fs/partitions/ultrix.h
@@ -2,12 +2,8 @@
* fs/partitions/ultrix.h
*/
-#define PT_MAGIC 0x032957 /* Partition magic number */
-#define PT_VALID 1 /* Indicates if struct is valid */
+static int ultrix_partition(struct gendisk *hd, kdev_t dev,
+ unsigned long first_sector);
-#define SBLOCK ((unsigned long)((16384 - sizeof(struct ultrix_disklabel)) \
- /get_ptable_blocksize(dev)))
-
-int ultrix_partition(struct gendisk *hd, kdev_t dev,
- unsigned long first_sector, int first_part_minor);
+#define SGI_LABEL_MAGIC 0x0be5a941