summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_disk.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-04-23 21:28:27 +0000
committerphk <phk@FreeBSD.org>2003-04-23 21:28:27 +0000
commitffd04bfbddd49c6770b05d62b4d4aa441be8e345 (patch)
tree2f6f2067280259902445ac8d739f9808ae338173 /sys/geom/geom_disk.c
parent89702db8fc31b7c5f4d8f4489268abaa95cbeb52 (diff)
downloadFreeBSD-src-ffd04bfbddd49c6770b05d62b4d4aa441be8e345.zip
FreeBSD-src-ffd04bfbddd49c6770b05d62b4d4aa441be8e345.tar.gz
Introduce a g_waitfor_event() function which posts an event and waits for
it to be run (or cancelled) and use this instead of home-rolled versions.
Diffstat (limited to 'sys/geom/geom_disk.c')
-rw-r--r--sys/geom/geom_disk.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index 91887b8..ec2e9b8 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -375,7 +375,6 @@ g_kern_disks(void *p, int flag __unused)
sp = " ";
}
sbuf_finish(sb);
- wakeup(sb);
}
static int
@@ -386,10 +385,7 @@ sysctl_disks(SYSCTL_HANDLER_ARGS)
sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND);
sbuf_clear(sb);
- g_post_event(g_kern_disks, sb, M_WAITOK, NULL);
- while (!sbuf_done(sb)) {
- tsleep(sb, PZERO, "kern.disks", hz);
- }
+ g_waitfor_event(g_kern_disks, sb, M_WAITOK, NULL);
error = SYSCTL_OUT(req, sbuf_data(sb), sbuf_len(sb) + 1);
sbuf_delete(sb);
return error;
OpenPOWER on IntegriCloud