diff options
author | phk <phk@FreeBSD.org> | 2002-10-20 20:28:24 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-10-20 20:28:24 +0000 |
commit | af63f9546ade194575238522dacd38cebe3b63f6 (patch) | |
tree | 4be4d44cd73707526477ac8dedf166de6841e46d /sys/geom/geom_pc98.c | |
parent | f0693daa1f5896bbd37f2ad85ba732389ac99646 (diff) | |
download | FreeBSD-src-af63f9546ade194575238522dacd38cebe3b63f6.zip FreeBSD-src-af63f9546ade194575238522dacd38cebe3b63f6.tar.gz |
Now that the sectorsize and mediasize are properties of the provider,
don't take the detour over the I/O path to discover them using getattr(),
we can just pick them out directly.
Do note though, that for now they are only valid after the first open
of the underlying disk device due compatibility with the old disk_create()
API. This will change in the future so they will always be valid.
Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sys/geom/geom_pc98.c')
-rw-r--r-- | sys/geom/geom_pc98.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/sys/geom/geom_pc98.c b/sys/geom/geom_pc98.c index a47724f..6aa466b 100644 --- a/sys/geom/geom_pc98.c +++ b/sys/geom/geom_pc98.c @@ -113,18 +113,10 @@ g_pc98_taste(struct g_class *mp, struct g_provider *pp, int flags) while (1) { /* a trick to allow us to use break */ if (gp->rank != 2 && flags == G_TF_NORMAL) break; - error = g_getattr("GEOM::sectorsize", cp, §orsize); - if (error) { - sectorsize = 512; - printf("g_pc98_taste: error %d Sectors are %d bytes\n", - error, sectorsize); - } - error = g_getattr("GEOM::mediasize", cp, &mediasize); - if (error) { - mediasize = 0; - printf("g_error %d Mediasize is %jd bytes\n", - error, (intmax_t)mediasize); - } + sectorsize = cp->provider->sectorsize; + if (sectorsize < 512) + break; + mediasize = cp->provider->mediasize; error = g_getattr("GEOM::fwsectors", cp, &fwsect); if (error || fwsect == 0) { fwsect = 17; |