diff options
author | asomers <asomers@FreeBSD.org> | 2016-04-21 16:43:15 +0000 |
---|---|---|
committer | asomers <asomers@FreeBSD.org> | 2016-04-21 16:43:15 +0000 |
commit | 5ffd1c3c24cf69bce3ad6373aa0257fa402f2bd2 (patch) | |
tree | 9509cb8972ac63902ca578e7fc9523a9a56d63b6 /sys/geom | |
parent | c16ba233cb310029accfb9c6863483878a9ab7af (diff) | |
download | FreeBSD-src-5ffd1c3c24cf69bce3ad6373aa0257fa402f2bd2.zip FreeBSD-src-5ffd1c3c24cf69bce3ad6373aa0257fa402f2bd2.tar.gz |
Notify userspace listeners when geom disk attributes have changed
sys/geom/geom_disk.c:
disk_attr_changed(): Generate a devctl event of type GEOM:<attr> for
every call.
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D5952
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom_disk.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index d503f67..fa505de 100644 --- a/sys/geom/geom_disk.c +++ b/sys/geom/geom_disk.c @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include <sys/kernel.h> #include <sys/sysctl.h> #include <sys/bio.h> +#include <sys/bus.h> #include <sys/ctype.h> #include <sys/fcntl.h> #include <sys/malloc.h> @@ -839,11 +840,14 @@ disk_attr_changed(struct disk *dp, const char *attr, int flag) { struct g_geom *gp; struct g_provider *pp; + char devnamebuf[128]; gp = dp->d_geom; if (gp != NULL) LIST_FOREACH(pp, &gp->provider, provider) (void)g_attr_changed(pp, attr, flag); + snprintf(devnamebuf, 128, "devname=%s%d", dp->d_name, dp->d_unit); + devctl_notify("GEOM", "disk", attr, devnamebuf); } void |