summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_pc98.c
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2004-10-08 21:27:27 +0000
committersos <sos@FreeBSD.org>2004-10-08 21:27:27 +0000
commit49fc63d1c8595ff2c00fb687bce4f7bf08dd5bd2 (patch)
tree2b9a2a4505fff76f41ff9c1a0fca3fe7b681bb44 /sys/geom/geom_pc98.c
parentbaf8b008c9797313952f6650a2ebba43acf7b99d (diff)
downloadFreeBSD-src-49fc63d1c8595ff2c00fb687bce4f7bf08dd5bd2.zip
FreeBSD-src-49fc63d1c8595ff2c00fb687bce4f7bf08dd5bd2.tar.gz
Only do the geometry translations on ad* devices, other devices seems to
have their own way of life. Those other devices translations should be moved here as well.
Diffstat (limited to 'sys/geom/geom_pc98.c')
-rw-r--r--sys/geom/geom_pc98.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/sys/geom/geom_pc98.c b/sys/geom/geom_pc98.c
index 355e121..9551b3f 100644
--- a/sys/geom/geom_pc98.c
+++ b/sys/geom/geom_pc98.c
@@ -258,24 +258,28 @@ g_pc98_taste(struct g_class *mp, struct g_provider *pp, int flags)
sectorsize = cp->provider->sectorsize;
if (sectorsize < 512)
break;
- if (cp->provider->mediasize/sectorsize < 17*8*65535) {
- fwsectors = 17;
- fwheads = 8;
- }
- else if (cp->provider->mediasize/sectorsize < 63*16*65535) {
- if (fwsectors > 63)
- fwsectors = 63;
- if (fwheads > 16)
- fwheads = 16;
- }
- else if (cp->provider->mediasize/sectorsize < 255*16*65535) {
- fwsectors = 255;
- if (fwheads > 16)
- fwheads = 16;
- }
- else {
- fwsectors = 255;
- fwheads = 255;
+ if (!strncmp(gp->name, "ad", 2)) {
+ u_int total_secs = cp->provider->mediasize/sectorsize;
+
+ if (total_secs < 17*8*65535) {
+ fwsectors = 17;
+ fwheads = 8;
+ }
+ else if (total_secs < 63*16*65535) {
+ if (fwsectors > 63)
+ fwsectors = 63;
+ if (fwheads > 16)
+ fwheads = 16;
+ }
+ else if (total_secs < 255*16*65535) {
+ fwsectors = 255;
+ if (fwheads > 16)
+ fwheads = 16;
+ }
+ else {
+ fwsectors = 255;
+ fwheads = 255;
+ }
}
buf = g_read_data(cp, 0, 8192, &error);
if (buf == NULL || error != 0)
OpenPOWER on IntegriCloud