NetBSD Problem Report #18256
Received: (qmail 13748 invoked by uid 605); 10 Sep 2002 16:16:23 -0000
Message-Id: <20020910161600.057B011122@narn.netbsd.org>
Date: Tue, 10 Sep 2002 09:16:00 -0700 (PDT)
From: sengel@melshake.com
Sender: gnats-bugs-owner@netbsd.org
Reply-To: sengel@melshake.com
To: gnats-bugs@gnats.netbsd.org
Subject: hpcarm MAXPATIONS bump request
X-Send-Pr-Version: www-1.0
>Number: 18256
>Category: port-hpcarm
>Synopsis: hpcarm MAXPATIONS bump request
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: port-hpcarm-maintainer
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Sep 10 16:17:00 +0000 2002
>Closed-Date: Sat Jul 17 15:27:54 +0000 2010
>Last-Modified: Sat Jul 17 15:27:54 +0000 2010
>Originator: Stephane Engel
>Release: current (1.6G as 20020904)
>Organization:
>Environment:
NetBSD minimi 1.6G NetBSD 1.6G (MINIMI) #0: Sun Sep 8 22:45:26 UTC 2002 root@minimi:/BSD/NetBSD/src/sys/arch/hpcarm/compile/MINIMI hpcarm
>Description:
Try to moot a removable disk with a disklabel made on a platform wich as MAXPARTITIONS = 16 (like i386).
It will failled with a disk label corrupted.
Also, see my mail :
http://mail-index.netbsd.org/port-hpcarm/2002/09/05/0001.html
>How-To-Repeat:
See "Full Description".
>Fix:
bump MAXPARTITIONS to 16.
the following patch work fine with my Jornada 720.
--- ./sys/arch/hpcarm/include/disklabel.h.orig Sat Sep 7 00:19:01 2002
+++ ./sys/arch/hpcarm/include/disklabel.h Sat Sep 7 00:33:33 2002
@@ -34,10 +34,24 @@
#define _MACHINE_DISKLABEL_H_
#define LABELSECTOR 1 /* sector containing label */
#define LABELOFFSET 0 /* offset of label in sector */
-#define MAXPARTITIONS 8 /* number of partitions */
+#define MAXPARTITIONS 16 /* number of partitions */
+#define OLDMAXPARTITIONS 8 /* number of partitions before 1.7 */
#define RAW_PART 3 /* raw partition: XX?d (XXX) */
+
+/*
+ * We use the highest bit of the minor number for the partition number.
+ * This maintains backward compatibility with device nodes created before
+ * MAXPARTITIONS was increased.
+ */
+#define __HPCARM_MAXDISKS ((1 << 20) / MAXPARTITIONS)
+#define DISKUNIT(dev) ((minor(dev) / OLDMAXPARTITIONS) % __HPCARM_MAXDISKS)
+#define DISKPART(dev) ((minor(dev) % OLDMAXPARTITIONS) + \
+ ((minor(dev) / (__HPCARM_MAXDISKS * OLDMAXPARTITIONS)) * OLDMAXPARTITIONS))
+#define DISKMINOR(unit, part) \
+ (((unit) * OLDMAXPARTITIONS) + ((part) % OLDMAXPARTITIONS) + \
+ ((part) / OLDMAXPARTITIONS) * (__HPCARM_MAXDISKS * OLDMAXPARTITIONS))
/* Pull in MBR partition definitions. */
#include <sys/disklabel_mbr.h>
--- ./sys/arch/hpcarm/include/types.h.orig Sat Sep 7 08:45:36 2002
+++ ./sys/arch/hpcarm/include/types.h Sat Sep 7 08:43:57 2002
@@ -7,6 +7,7 @@
#define __HAVE_DEVICE_REGISTER
#define __HAVE_NWSCONS
#define __HAVE_GENERIC_SOFT_INTERRUPTS
+#define __HAVE_OLD_DISKLABEL
#endif
>Release-Note:
>Audit-Trail:
From: Izumi Tsutsui <tsutsui@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/18256 CVS commit: src/sys/arch/hpcarm/include
Date: Sat, 17 Jul 2010 15:13:18 +0000
Module Name: src
Committed By: tsutsui
Date: Sat Jul 17 15:13:18 UTC 2010
Modified Files:
src/sys/arch/hpcarm/include: disklabel.h types.h
Log Message:
Bump MAXPARTITIONS from 8 to 16 using __HAVE_OLD_DISKLABEL compat method
as i386 and hpcmips. PR port-hpcarm/18256
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hpcarm/include/disklabel.h
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hpcarm/include/types.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: tsutsui@NetBSD.org
State-Changed-When: Sun, 18 Jul 2010 00:27:54 +0900
State-Changed-Why:
Finally it's bumped. Thanks,
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.