geom_event.c (109170) | geom_event.c (109623) |
---|---|
1/*- 2 * Copyright (c) 2002 Poul-Henning Kamp 3 * Copyright (c) 2002 Networks Associates Technology, Inc. 4 * All rights reserved. 5 * 6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp 7 * and NAI Labs, the Security Research Division of Network Associates, Inc. 8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the --- 18 unchanged lines hidden (view full) --- 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * | 1/*- 2 * Copyright (c) 2002 Poul-Henning Kamp 3 * Copyright (c) 2002 Networks Associates Technology, Inc. 4 * All rights reserved. 5 * 6 * This software was developed for the FreeBSD Project by Poul-Henning Kamp 7 * and NAI Labs, the Security Research Division of Network Associates, Inc. 8 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the --- 18 unchanged lines hidden (view full) --- 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 * |
35 * $FreeBSD: head/sys/geom/geom_event.c 109170 2003-01-13 08:46:32Z phk $ | 35 * $FreeBSD: head/sys/geom/geom_event.c 109623 2003-01-21 08:56:16Z alfred $ |
36 */ 37 38/* 39 * XXX: How do we in general know that objects referenced in events 40 * have not been destroyed before we get around to handle the event ? 41 */ 42 43#include <sys/param.h> --- 217 unchanged lines hidden (view full) --- 261void 262g_post_event(enum g_events ev, struct g_class *mp, struct g_geom *gp, struct g_provider *pp, struct g_consumer *cp) 263{ 264 struct g_event *ep; 265 266 g_trace(G_T_TOPOLOGY, "g_post_event(%d, %p, %p, %p, %p)", 267 ev, mp, gp, pp, cp); 268 g_topology_assert(); | 36 */ 37 38/* 39 * XXX: How do we in general know that objects referenced in events 40 * have not been destroyed before we get around to handle the event ? 41 */ 42 43#include <sys/param.h> --- 217 unchanged lines hidden (view full) --- 261void 262g_post_event(enum g_events ev, struct g_class *mp, struct g_geom *gp, struct g_provider *pp, struct g_consumer *cp) 263{ 264 struct g_event *ep; 265 266 g_trace(G_T_TOPOLOGY, "g_post_event(%d, %p, %p, %p, %p)", 267 ev, mp, gp, pp, cp); 268 g_topology_assert(); |
269 ep = g_malloc(sizeof *ep, M_WAITOK | M_ZERO); | 269 ep = g_malloc(sizeof *ep, M_ZERO); |
270 ep->event = ev; 271 if (mp != NULL) { 272 ep->class = mp; 273 KASSERT(mp->event == NULL, ("Double event on class %d %d", 274 ep->event, mp->event->event)); 275 mp->event = ep; 276 } 277 if (gp != NULL) { --- 64 unchanged lines hidden --- | 270 ep->event = ev; 271 if (mp != NULL) { 272 ep->class = mp; 273 KASSERT(mp->event == NULL, ("Double event on class %d %d", 274 ep->event, mp->event->event)); 275 mp->event = ep; 276 } 277 if (gp != NULL) { --- 64 unchanged lines hidden --- |