summaryrefslogtreecommitdiffstats
path: root/fs/partitions
diff options
context:
space:
mode:
authorHarald Koerfgen <hkoerfg@web.de>1999-10-12 17:33:49 +0000
committerHarald Koerfgen <hkoerfg@web.de>1999-10-12 17:33:49 +0000
commitf20726c6656eb8412fafe93d7e42bef64819bb99 (patch)
tree1bb272e9142f126b49fdb26a80d7051eeb6b7e6e /fs/partitions
parentd6434e1042f3b0a6dfe1b1f615af369486f9b1fa (diff)
o R3000 fixes
o moved to original 2.3.19 NCR53C9x driver o CONFIG_ULTRIX_PARTION is working again and now big endian proof
Diffstat (limited to 'fs/partitions')
-rw-r--r--fs/partitions/Config.in4
-rw-r--r--fs/partitions/check.c1
-rw-r--r--fs/partitions/ultrix.c25
-rw-r--r--fs/partitions/ultrix.h13
4 files changed, 26 insertions, 17 deletions
diff --git a/fs/partitions/Config.in b/fs/partitions/Config.in
index 31e5884f4..c07773786 100644
--- a/fs/partitions/Config.in
+++ b/fs/partitions/Config.in
@@ -28,10 +28,8 @@ if [ "$CONFIG_SGI_IP22" != "y" ]; then
else
define_bool CONFIG_SGI_PARTITION y
fi
-if [ "$CONFIG_DECSTATION" != "y" ]; then
+if [ "$CONFIG_PARTITION_ADVANCED" = "y" ]; then
bool 'Ultrix partition table support' CONFIG_ULTRIX_PARTITION
-else
- define_bool CONFIG_ULTRIX_PARTITION y
fi
if [ "$ARCH" != "sparc" -a "$ARCH" != "sparc64" ]; then
bool 'Sun partition tables support' CONFIG_SUN_PARTITION
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 76476f512..e3d8ed60b 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -29,6 +29,7 @@
#include "osf.h"
#include "sgi.h"
#include "sun.h"
+#include "ultrix.h"
extern void device_init(void);
extern void md_setup_drive(void);
diff --git a/fs/partitions/ultrix.c b/fs/partitions/ultrix.c
index fcfaf0d22..1de4d04b0 100644
--- a/fs/partitions/ultrix.c
+++ b/fs/partitions/ultrix.c
@@ -13,10 +13,11 @@
#include <linux/blk.h>
#include "check.h"
+#include "ultrix.h"
-static int ultrix_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector)
+int ultrix_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector, int first_part_minor)
{
- int i, minor = current_minor;
+ int i;
struct buffer_head *bh;
struct ultrix_disklabel {
s32 pt_magic; /* magic no. indicating part. info exits */
@@ -27,12 +28,6 @@ static int ultrix_partition(struct gendisk *hd, kdev_t dev, unsigned long first_
} 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);
@@ -43,12 +38,14 @@ static int ultrix_partition(struct gendisk *hd, kdev_t dev, unsigned long first_
+ 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_gd_partition(hd, minor,
- label->pt_part[i].pi_blkoff,
- label->pt_part[i].pi_nblocks);
+ 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));
+
brelse(bh);
printk ("\n");
return 1;
diff --git a/fs/partitions/ultrix.h b/fs/partitions/ultrix.h
new file mode 100644
index 000000000..b2d24fdfd
--- /dev/null
+++ b/fs/partitions/ultrix.h
@@ -0,0 +1,13 @@
+/*
+ * fs/partitions/ultrix.h
+ */
+
+#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)))
+
+int ultrix_partition(struct gendisk *hd, kdev_t dev,
+ unsigned long first_sector, int first_part_minor);
+