Commit 16939bd3 authored by Roland McGrath's avatar Roland McGrath Committed by Linus Torvalds

[PATCH] BSD disklabel: handle more than 8 partitions

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.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 64b1f2ed
...@@ -246,6 +246,9 @@ parse_bsd(struct parsed_partitions *state, struct block_device *bdev, ...@@ -246,6 +246,9 @@ parse_bsd(struct parsed_partitions *state, struct block_device *bdev,
put_partition(state, state->next++, bsd_start, bsd_size); put_partition(state, state->next++, bsd_start, bsd_size);
} }
put_dev_sector(sect); 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"); printk(" >\n");
} }
#endif #endif
......
...@@ -249,7 +249,7 @@ struct solaris_x86_vtoc { ...@@ -249,7 +249,7 @@ struct solaris_x86_vtoc {
/* check against BSD src/sys/sys/disklabel.h for consistency */ /* check against BSD src/sys/sys/disklabel.h for consistency */
#define BSD_DISKMAGIC (0x82564557UL) /* The disk magic number */ #define BSD_DISKMAGIC (0x82564557UL) /* The disk magic number */
#define BSD_MAXPARTITIONS 8 #define BSD_MAXPARTITIONS 16
#define OPENBSD_MAXPARTITIONS 16 #define OPENBSD_MAXPARTITIONS 16
#define BSD_FS_UNUSED 0 /* disklabel unused partition entry ID */ #define BSD_FS_UNUSED 0 /* disklabel unused partition entry ID */
struct bsd_disklabel { struct bsd_disklabel {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment