From dd866faa707ae5248bcb678122dd6e68dfc09c5b Mon Sep 17 00:00:00 2001 From: marcel Date: Fri, 28 Mar 2008 06:31:12 +0000 Subject: When retasting, wither any existing GEOMs of the same class. This allows the class to create a different GEOM for the same provider as well as avoid that we end up with multiple GEOMs of the same class with the same name. For example, when a disk contains a PC98 partition table but only MBR is supported, then the partition table can be treated as a MBR. If support for PC98 is later loaded as a module, the MBR scheme is pre-empted for the PC98 scheme as expected. --- sys/geom/geom_subr.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sys/geom/geom_subr.c') diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index 08f1ce3..6e4b7ed 100644 --- a/sys/geom/geom_subr.c +++ b/sys/geom/geom_subr.c @@ -253,7 +253,7 @@ static void g_retaste_event(void *arg, int flag) { struct g_class *cp, *mp; - struct g_geom *gp; + struct g_geom *gp, *gp2; struct g_hh00 *hh; struct g_provider *pp; @@ -277,6 +277,12 @@ g_retaste_event(void *arg, int flag) LIST_FOREACH(pp, &gp->provider, provider) { if (pp->acr || pp->acw || pp->ace) continue; + LIST_FOREACH(gp2, &mp->geom, geom) { + if (!strcmp(pp->name, gp2->name)) + break; + } + if (gp2 != NULL) + g_wither_geom(gp2, ENXIO); mp->taste(mp, pp, 0); g_topology_assert(); } -- cgit v1.1