summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_dev.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-06-17 21:24:13 +0000
committerphk <phk@FreeBSD.org>2004-06-17 21:24:13 +0000
commit7dd1d04ac065be210014388f240f045441efd820 (patch)
treef40b1612e107469fa7fe45ff6a9e1f36d26bb2f4 /sys/geom/geom_dev.c
parent0479585a9d87cc726cd2b3cdb44ebebafe406c84 (diff)
downloadFreeBSD-src-7dd1d04ac065be210014388f240f045441efd820.zip
FreeBSD-src-7dd1d04ac065be210014388f240f045441efd820.tar.gz
Reduce the thaumaturgical level of root filesystem mounts: Instead of using
an otherwise redundant clone routine in geom_disk.c, mount a temporary DEVFS and do a proper lookup. Submitted by: thomas
Diffstat (limited to 'sys/geom/geom_dev.c')
-rw-r--r--sys/geom/geom_dev.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index 5c16763..f24400a 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -91,49 +91,6 @@ g_dev_print(void)
printf("\n");
}
-/*
- * XXX: This is disgusting and wrong in every way imaginable: The only reason
- * XXX: we have a clone function is because of the root-mount hack we currently
- * XXX: employ. An improvment would be to unregister this cloner once we know
- * XXX: we no longer need it. Ideally, root-fs would be mounted through DEVFS
- * XXX: eliminating the need for this hack.
- */
-static void
-g_dev_clone(void *arg __unused, char *name, int namelen __unused, struct cdev **dev)
-{
- struct g_geom *gp;
-
- if (*dev != NULL)
- return;
-
- g_waitidle();
-
- /* g_topology_lock(); */
- LIST_FOREACH(gp, &g_dev_class.geom, geom) {
- if (strcmp(gp->name, name))
- continue;
- *dev = gp->softc;
- g_trace(G_T_TOPOLOGY, "g_dev_clone(%s) = %p", name, *dev);
- return;
- }
- /* g_topology_unlock(); */
- return;
-}
-
-static void
-g_dev_register_cloner(void *foo __unused)
-{
- static int once;
-
- /* XXX: why would this happen more than once ?? */
- if (!once) {
- EVENTHANDLER_REGISTER(dev_clone, g_dev_clone, 0, 1000);
- once++;
- }
-}
-
-SYSINIT(geomdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE,g_dev_register_cloner,NULL);
-
struct g_provider *
g_dev_getprovider(struct cdev *dev)
{
OpenPOWER on IntegriCloud