summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1993-12-23 09:35:51 +0000
committercgd <cgd@NetBSD.org>1993-12-23 09:35:51 +0000
commitf59a5e6fcd0d4cd89d41e4439eb2e816bc405ccd (patch)
tree40e03df04ae181d52e93dc0bb9a529b5cfc077a6 /sys/dev
parent2b82a53661e62c9064fe86a536281fa7ba3cef55 (diff)
fix from Nick Cuccia (cuccia@remarque.berkeley.edu), apparently
originating from Gary Grebus <glg@k8lt.ampr.org>: partition size must be in units of DEV_BSIZE.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/scsipi/cd.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/scsipi/cd.c b/sys/dev/scsipi/cd.c
index ce5d67aa3f7..ee1ea441763 100644
--- a/sys/dev/scsipi/cd.c
+++ b/sys/dev/scsipi/cd.c
@@ -13,7 +13,7 @@
* on the understanding that TFS is not responsible for the correct
* functioning of this software in any circumstances.
*
- * $Id: cd.c,v 1.19 1993/12/17 08:50:33 mycroft Exp $
+ * $Id: cd.c,v 1.20 1993/12/23 09:35:51 cgd Exp $
*/
#define SPLCD splbio
@@ -972,9 +972,14 @@ unsigned char unit;
cd->disklabel.d_flags = D_REMOVABLE;
cd->disklabel.d_npartitions = 1;
- cd->disklabel.d_partitions[0].p_offset = 0;
- cd->disklabel.d_partitions[0].p_size = cd->params.disksize;
- cd->disklabel.d_partitions[0].p_fstype = 9;
+ cd->disklabel.d_partitions[0].p_offset = 0;
+ /*
+ * remember that comparisons with the partition are done
+ * assuming the blocks are DEV_BSIZE each, so fudge it.
+ */
+ cd->disklabel.d_partitions[0].p_size =
+ cd->params.disksize * (cd->params.blksize / DEV_BSIZE);
+ cd->disklabel.d_partitions[0].p_fstype = 9;
cd->disklabel.d_magic = DISKMAGIC;
cd->disklabel.d_magic2 = DISKMAGIC;