diff options
author | marcel <marcel@FreeBSD.org> | 2008-03-28 06:31:12 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2008-03-28 06:31:12 +0000 |
commit | dd866faa707ae5248bcb678122dd6e68dfc09c5b (patch) | |
tree | 1e38f65c66abac7ab5ff8e76620abd9126cfc68e /sys | |
parent | 41d5b26ff8d7a88a81316dcf6014be2acd0553f9 (diff) | |
download | FreeBSD-src-dd866faa707ae5248bcb678122dd6e68dfc09c5b.zip FreeBSD-src-dd866faa707ae5248bcb678122dd6e68dfc09c5b.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/geom/geom_subr.c | 8 |
1 files changed, 7 insertions, 1 deletions
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(); } |