From 59689f1f05493a8789b2a31a81091f52611d1879 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 22 Feb 1998 10:11:23 +0000 Subject: [PATCH] The changes I had made long ago to support >32 disk-type units was incomplete; dkmakeminor was broken for >32. I noticed this when trying to use more than 32 ccd units on wcarchive. Reviewed by: bde --- sys/sys/disklabel.h | 5 +++-- sys/sys/diskmbr.h | 5 +++-- sys/sys/diskpc98.h | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h index 2d21452968e3..58ad909de83f 100644 --- a/sys/sys/disklabel.h +++ b/sys/sys/disklabel.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)disklabel.h 8.2 (Berkeley) 7/10/94 - * $Id: disklabel.h,v 1.29 1998/02/01 20:08:36 bde Exp $ + * $Id: disklabel.h,v 1.30 1998/02/17 10:50:20 jkh Exp $ */ #ifndef _SYS_DISKLABEL_H_ @@ -414,7 +414,8 @@ struct dos_partition { ----------------------------------------------------------------- */ #define dkmakeminor(unit, slice, part) \ - (((slice) << 16) | ((unit) << 3) | (part)) + (((slice) << 16) | (((unit) & 0x1e0) << 16) | \ + (((unit) & 0x1f) << 3) | (part)) #define dkmodpart(dev, part) (((dev) & ~(dev_t)7) | (part)) #define dkmodslice(dev, slice) (((dev) & ~(dev_t)0x1f0000) | ((slice) << 16)) #define dkpart(dev) (minor(dev) & 7) diff --git a/sys/sys/diskmbr.h b/sys/sys/diskmbr.h index 2d21452968e3..58ad909de83f 100644 --- a/sys/sys/diskmbr.h +++ b/sys/sys/diskmbr.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)disklabel.h 8.2 (Berkeley) 7/10/94 - * $Id: disklabel.h,v 1.29 1998/02/01 20:08:36 bde Exp $ + * $Id: disklabel.h,v 1.30 1998/02/17 10:50:20 jkh Exp $ */ #ifndef _SYS_DISKLABEL_H_ @@ -414,7 +414,8 @@ struct dos_partition { ----------------------------------------------------------------- */ #define dkmakeminor(unit, slice, part) \ - (((slice) << 16) | ((unit) << 3) | (part)) + (((slice) << 16) | (((unit) & 0x1e0) << 16) | \ + (((unit) & 0x1f) << 3) | (part)) #define dkmodpart(dev, part) (((dev) & ~(dev_t)7) | (part)) #define dkmodslice(dev, slice) (((dev) & ~(dev_t)0x1f0000) | ((slice) << 16)) #define dkpart(dev) (minor(dev) & 7) diff --git a/sys/sys/diskpc98.h b/sys/sys/diskpc98.h index 2d21452968e3..58ad909de83f 100644 --- a/sys/sys/diskpc98.h +++ b/sys/sys/diskpc98.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)disklabel.h 8.2 (Berkeley) 7/10/94 - * $Id: disklabel.h,v 1.29 1998/02/01 20:08:36 bde Exp $ + * $Id: disklabel.h,v 1.30 1998/02/17 10:50:20 jkh Exp $ */ #ifndef _SYS_DISKLABEL_H_ @@ -414,7 +414,8 @@ struct dos_partition { ----------------------------------------------------------------- */ #define dkmakeminor(unit, slice, part) \ - (((slice) << 16) | ((unit) << 3) | (part)) + (((slice) << 16) | (((unit) & 0x1e0) << 16) | \ + (((unit) & 0x1f) << 3) | (part)) #define dkmodpart(dev, part) (((dev) & ~(dev_t)7) | (part)) #define dkmodslice(dev, slice) (((dev) & ~(dev_t)0x1f0000) | ((slice) << 16)) #define dkpart(dev) (minor(dev) & 7)