summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcsapuntz <csapuntz@openbsd.org>1998-07-23 05:27:37 +0000
committercsapuntz <csapuntz@openbsd.org>1998-07-23 05:27:37 +0000
commit2133ecf957911ce4dd2e52dfb56b3953c407e034 (patch)
treed09080fd5c8a9637cb5320be0e845e9a1143c5ef
parentFix annoying bug where disklabel would give you wrong default size for last (diff)
downloadwireguard-openbsd-2133ecf957911ce4dd2e52dfb56b3953c407e034.tar.xz
wireguard-openbsd-2133ecf957911ce4dd2e52dfb56b3953c407e034.zip
Support drives > 8.4GB
For LBA-capable drives, return the number of LBA sectors as secperunit, not the number you get from CHS. Note, DOS partition tables are limited to 8.4GB. The interactive disklabel editor will notice that the OpenBSD partition ends at 8.4GB and limit the user to that size unless the user explicitly specifies the bounds. This should probably be changed.
-rw-r--r--sys/dev/isa/wd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/isa/wd.c b/sys/dev/isa/wd.c
index f8c407ae7b1..e0b2c8c1868 100644
--- a/sys/dev/isa/wd.c
+++ b/sys/dev/isa/wd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wd.c,v 1.33 1998/07/23 04:40:11 csapuntz Exp $ */
+/* $OpenBSD: wd.c,v 1.34 1998/07/23 05:27:37 csapuntz Exp $ */
/* $NetBSD: wd.c,v 1.150 1996/05/12 23:54:03 mycroft Exp $ */
/*
@@ -551,7 +551,11 @@ wdgetdisklabel(dev, wd)
lp->d_type = DTYPE_ST506;
#endif
strncpy(lp->d_packname, d_link->sc_params.wdp_model, 16);
- lp->d_secperunit = lp->d_secpercyl * lp->d_ncylinders;
+ if ((d_link->sc_params.wdp_capabilities & WD_CAP_LBA)) {
+ lp->d_secperunit = d_link->sc_params.wdp_lbacapacity;
+ } else
+ lp->d_secperunit = lp->d_secpercyl * lp->d_ncylinders;
+
lp->d_rpm = 3600;
lp->d_interleave = 1;
lp->d_flags = 0;