
From: Ralf Baechle <ralf@linux-mips.org>

 o Make CONFIG_SGI_PARTITION the default for those systems where firmware or
   host OS require it.
 o Check earlier for DVH aka SGI partitions to avoid confusing them with an
   MSDOS partition.
 o Detect RAID partitions on IRIX volumes.  Caveat: this uses one of the
   officially unused partition types which are not recogniced by the IRIX or
   RISC/os tools.  Doesn't seem to matter but should be mentioned for
   completeness.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/partitions/Kconfig |    2 +-
 25-akpm/fs/partitions/check.c |    6 +++---
 25-akpm/fs/partitions/sgi.c   |    8 ++++++--
 3 files changed, 10 insertions(+), 6 deletions(-)

diff -puN fs/partitions/check.c~mips-dvh-fixes fs/partitions/check.c
--- 25/fs/partitions/check.c~mips-dvh-fixes	2005-01-29 11:25:57.113186784 -0800
+++ 25-akpm/fs/partitions/check.c	2005-01-29 11:25:57.121185568 -0800
@@ -73,6 +73,9 @@ static int (*check_part[])(struct parsed
 #ifdef CONFIG_EFI_PARTITION
 	efi_partition,		/* this must come before msdos */
 #endif
+#ifdef CONFIG_SGI_PARTITION
+	sgi_partition,
+#endif
 #ifdef CONFIG_LDM_PARTITION
 	ldm_partition,		/* this must come before msdos */
 #endif
@@ -97,9 +100,6 @@ static int (*check_part[])(struct parsed
 #ifdef CONFIG_MAC_PARTITION
 	mac_partition,
 #endif
-#ifdef CONFIG_SGI_PARTITION
-	sgi_partition,
-#endif
 #ifdef CONFIG_ULTRIX_PARTITION
 	ultrix_partition,
 #endif
diff -puN fs/partitions/Kconfig~mips-dvh-fixes fs/partitions/Kconfig
--- 25/fs/partitions/Kconfig~mips-dvh-fixes	2005-01-29 11:25:57.115186480 -0800
+++ 25-akpm/fs/partitions/Kconfig	2005-01-29 11:25:57.120185720 -0800
@@ -188,7 +188,7 @@ config LDM_DEBUG
 
 config SGI_PARTITION
 	bool "SGI partition support" if PARTITION_ADVANCED
-	default y if (SGI_IP22 || SGI_IP27)
+	default y if (SGI_IP22 || SGI_IP27 || ((MACH_JAZZ || SNI_RM200_PCI) && !CPU_LITTLE_ENDIAN))
 	help
 	  Say Y here if you would like to be able to read the hard disk
 	  partition table format used by SGI machines.
diff -puN fs/partitions/sgi.c~mips-dvh-fixes fs/partitions/sgi.c
--- 25/fs/partitions/sgi.c~mips-dvh-fixes	2005-01-29 11:25:57.116186328 -0800
+++ 25-akpm/fs/partitions/sgi.c	2005-01-29 11:25:57.121185568 -0800
@@ -69,8 +69,12 @@ int sgi_partition(struct parsed_partitio
 	for(i = 0; i < 16; i++, p++) {
 		blocks = be32_to_cpu(p->num_blocks);
 		start  = be32_to_cpu(p->first_block);
-		if (blocks)
-			put_partition(state, slot++, start, blocks);
+		if (blocks) {
+			put_partition(state, slot, start, blocks);
+			if (be32_to_cpu(p->type) == LINUX_RAID_PARTITION)
+				state->parts[slot].flags = 1;
+		}
+		slot++;
 	}
 	printk("\n");
 	put_dev_sector(sect);
_
