From af63f9546ade194575238522dacd38cebe3b63f6 Mon Sep 17 00:00:00 2001 From: phk Date: Sun, 20 Oct 2002 20:28:24 +0000 Subject: 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. --- sys/geom/geom_gpt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/geom/geom_gpt.c') diff --git a/sys/geom/geom_gpt.c b/sys/geom/geom_gpt.c index ef23af0..6f90507 100644 --- a/sys/geom/geom_gpt.c +++ b/sys/geom/geom_gpt.c @@ -168,8 +168,8 @@ g_gpt_taste(struct g_class *mp, struct g_provider *pp, int insist) if (gp->rank != 2 && insist == 0) break; - error = g_getattr("GEOM::sectorsize", cp, &secsz); - if (error) + secsz = cp->provider->sectorsize; + if (secsz < 512) break; /* XXX: we need to get the media size as well. */ -- cgit v1.1