linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] BSD disklabel: handle more than 8 partitions
@ 2004-09-12  2:48 Roland McGrath
  0 siblings, 0 replies; only message in thread
From: Roland McGrath @ 2004-09-12  2:48 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: Linux Kernel Mailing List


NetBSD allows 16 partitions, not just 8.  This patch both ups the number,
and makes the recognition code tell you if the count in the disklabel
exceeds the number supported by the kernel.


Thanks,
Roland


Index: linux-2.6/include/linux/genhd.h
===================================================================
RCS file: /home/roland/redhat/bkcvs/linux-2.5/include/linux/genhd.h,v
retrieving revision 1.51
diff -b -p -u -r1.51 genhd.h
--- linux-2.6/include/linux/genhd.h 24 Aug 2004 18:28:31 -0000 1.51
+++ linux-2.6/include/linux/genhd.h 12 Sep 2004 01:25:58 -0000
@@ -249,7 +249,7 @@ struct solaris_x86_vtoc {
 /* check against BSD src/sys/sys/disklabel.h for consistency */
 
 #define BSD_DISKMAGIC	(0x82564557UL)	/* The disk magic number */
-#define BSD_MAXPARTITIONS	8
+#define BSD_MAXPARTITIONS	16
 #define OPENBSD_MAXPARTITIONS	16
 #define BSD_FS_UNUSED		0	/* disklabel unused partition entry ID */
 struct bsd_disklabel {
Index: linux-2.6/fs/partitions/msdos.c
===================================================================
RCS file: /home/roland/redhat/bkcvs/linux-2.5/fs/partitions/msdos.c,v
retrieving revision 1.25
diff -b -p -u -r1.25 msdos.c
--- linux-2.6/fs/partitions/msdos.c 24 Jun 2004 16:50:56 -0000 1.25
+++ linux-2.6/fs/partitions/msdos.c 12 Sep 2004 01:34:35 -0000
@@ -246,6 +246,9 @@ parse_bsd(struct parsed_partitions *stat
 		put_partition(state, state->next++, bsd_start, bsd_size);
 	}
 	put_dev_sector(sect);
+	if (le16_to_cpu(l->d_npartitions) > max_partitions)
+		printk(" (ignored %d more)",
+		       le16_to_cpu(l->d_npartitions) - max_partitions);
 	printk(" >\n");
 }
 #endif

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-09-12  2:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-12  2:48 [PATCH] BSD disklabel: handle more than 8 partitions Roland McGrath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).