From: Roland McGrath <roland@frob.com>
To: Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] BSD disklabel: handle more than 8 partitions
Date: Sat, 11 Sep 2004 19:48:10 -0700 [thread overview]
Message-ID: <200409120248.i8C2mAeW025899@magilla.sf.frob.com> (raw)
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
reply other threads:[~2004-09-12 2:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200409120248.i8C2mAeW025899@magilla.sf.frob.com \
--to=roland@frob.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®