summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2000-04-07 13:53:41 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2000-04-07 13:53:41 +0000
commit68d898d871e26d8e03abe1e9901dd20920b75078 (patch)
tree950f5e0d6f0efc9435f810bc5efc0fe5753489b6
parent6384871272859e18f8ca1e245ccd18741738bfa9 (diff)
add DISKMINOR(), and repair redefinitions
-rw-r--r--sys/sys/disklabel.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h
index b3aeeef58a0..e596a7f7766 100644
--- a/sys/sys/disklabel.h
+++ b/sys/sys/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.17 1999/01/11 10:23:42 niklas Exp $ */
+/* $OpenBSD: disklabel.h,v 1.18 2000/04/07 13:53:40 deraadt Exp $ */
/* $NetBSD: disklabel.h,v 1.41 1996/05/10 23:07:37 mark Exp $ */
/*
@@ -66,9 +66,12 @@
*/
#define DISKUNIT(dev) (minor(dev) / MAXPARTITIONS)
#define DISKPART(dev) (minor(dev) % MAXPARTITIONS)
+#define DISKMINOR(unit, part) \
+ (((unit) * MAXPARTITIONS) + (part))
#define MAKEDISKDEV(maj, unit, part) \
- (makedev((maj), ((unit) * MAXPARTITIONS) + (part)))
-#define DISKLABELDEV(dev) (MAKEDISKDEV(major(dev), DISKUNIT(dev), RAW_PART))
+ (makedev((maj), DISKMINOR((unit), (part))))
+#define DISKLABELDEV(dev) \
+ (MAKEDISKDEV(major(dev), DISKUNIT(dev), RAW_PART))
#define DISKMAGIC ((u_int32_t)0x82564557) /* The disk magic number */