summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2015-05-15 10:42:48 +0000
committertrasz <trasz@FreeBSD.org>2015-05-15 10:42:48 +0000
commit7fcf215ed50ad2ca01604585e13972f046847976 (patch)
treed20083c8b0d9211bbb28c69c00d24f1d06743f0c /sys
parent0cc31562c36f9be32c8e059909585d0585a9fbf6 (diff)
downloadFreeBSD-src-7fcf215ed50ad2ca01604585e13972f046847976.zip
FreeBSD-src-7fcf215ed50ad2ca01604585e13972f046847976.tar.gz
MFC r277170:
Add devd(8) notifications for creation and destruction of GEOM devices. Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys')
-rw-r--r--sys/geom/geom_dev.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index 6d02ccb..b53065d 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -169,12 +169,15 @@ g_dev_destroy(void *arg, int flags __unused)
struct g_consumer *cp;
struct g_geom *gp;
struct g_dev_softc *sc;
+ char buf[SPECNAMELEN + 6];
g_topology_assert();
cp = arg;
gp = cp->geom;
sc = cp->private;
g_trace(G_T_TOPOLOGY, "g_dev_destroy(%p(%s))", cp, gp->name);
+ snprintf(buf, sizeof(buf), "cdev=%s", gp->name);
+ devctl_notify_f("GEOM", "DEV", "DESTROY", buf, M_WAITOK);
if (cp->acr > 0 || cp->acw > 0 || cp->ace > 0)
g_access(cp, -cp->acr, -cp->acw, -cp->ace);
g_detach(cp);
@@ -209,11 +212,14 @@ g_dev_attrchanged(struct g_consumer *cp, const char *attr)
dev = sc->sc_dev;
snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name);
devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, M_WAITOK);
+ devctl_notify_f("GEOM", "DEV", "MEDIACHANGE", buf, M_WAITOK);
dev = sc->sc_alias;
if (dev != NULL) {
snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name);
devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf,
M_WAITOK);
+ devctl_notify_f("GEOM", "DEV", "MEDIACHANGE", buf,
+ M_WAITOK);
}
return;
}
@@ -269,7 +275,7 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
struct g_dev_softc *sc;
int error, len;
struct cdev *dev, *adev;
- char buf[64], *val;
+ char buf[SPECNAMELEN + 6], *val;
g_trace(G_T_TOPOLOGY, "dev_taste(%s,%s)", mp->name, pp->name);
g_topology_assert();
@@ -324,6 +330,8 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, int insist __unused)
}
g_dev_attrchanged(cp, "GEOM::physpath");
+ snprintf(buf, sizeof(buf), "cdev=%s", gp->name);
+ devctl_notify_f("GEOM", "DEV", "CREATE", buf, M_WAITOK);
return (gp);
}
OpenPOWER on IntegriCloud