diff options
author | phk <phk@FreeBSD.org> | 2003-04-23 20:46:12 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-04-23 20:46:12 +0000 |
commit | 3bbfe9f43b9f428fa76cf6b43be961ff03071025 (patch) | |
tree | 2d203b1d0b7761a17e73c3483c4149f9172a544b /sys/geom/geom_event.c | |
parent | f0e2ab20a0f8aec13b4380cbf6075819af64c9a7 (diff) | |
download | FreeBSD-src-3bbfe9f43b9f428fa76cf6b43be961ff03071025.zip FreeBSD-src-3bbfe9f43b9f428fa76cf6b43be961ff03071025.tar.gz |
Rename g_call_me() to g_post_event(), and give it a flag
argument to determine if we can M_WAITOK in malloc.
Diffstat (limited to 'sys/geom/geom_event.c')
-rw-r--r-- | sys/geom/geom_event.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/geom/geom_event.c b/sys/geom/geom_event.c index e974216..ec34c87 100644 --- a/sys/geom/geom_event.c +++ b/sys/geom/geom_event.c @@ -210,18 +210,20 @@ g_cancel_event(void *ref) } int -g_call_me(g_call_me_t *func, void *arg, ...) +g_post_event(g_event_t *func, void *arg, int flag, ...) { struct g_event *ep; va_list ap; void *p; u_int n; - g_trace(G_T_TOPOLOGY, "g_call_me(%p, %p", func, arg); - ep = g_malloc(sizeof *ep, M_NOWAIT | M_ZERO); + g_trace(G_T_TOPOLOGY, "g_post_event(%p, %p, %d", func, arg, flag); + KASSERT(flag == M_NOWAIT || flag == M_WAITOK, + ("Wrong flag to g_post_event")); + ep = g_malloc(sizeof *ep, flag | M_ZERO); if (ep == NULL) return (ENOMEM); - va_start(ap, arg); + va_start(ap, flag); for (n = 0; n < G_N_EVENTREFS; n++) { p = va_arg(ap, void *); if (p == NULL) |