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.
This commit is contained in:
Marcel Moolenaar 2008-03-28 06:31:12 +00:00
parent 6e7534b8c8
commit 856744ba93

View File

@ -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();
}