From 4123c26bf2ab0d197a9dbbdee6a5767148a391b6 Mon Sep 17 00:00:00 2001 From: dlg Date: Fri, 2 Jan 2015 10:32:21 +0000 Subject: [PATCH] store all state needed to defer probe/detach events in vscsi_devevent_task. --- sys/dev/vscsi.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/dev/vscsi.c b/sys/dev/vscsi.c index 9e6f8de5c5b..c9938dea03c 100644 --- a/sys/dev/vscsi.c +++ b/sys/dev/vscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vscsi.c,v 1.34 2014/10/17 02:05:06 tedu Exp $ */ +/* $OpenBSD: vscsi.c,v 1.35 2015/01/02 10:32:21 dlg Exp $ */ /* * Copyright (c) 2008 David Gwynne @@ -472,6 +472,7 @@ vscsi_t2i(struct vscsi_softc *sc, struct vscsi_ioc_t2i *t2i) } struct vscsi_devevent_task { + struct vscsi_softc *sc; struct task t; struct vscsi_ioc_devevent de; u_long cmd; @@ -487,7 +488,8 @@ vscsi_devevent(struct vscsi_softc *sc, u_long cmd, if (dt == NULL) return (ENOMEM); - task_set(&dt->t, vscsi_devevent_task, sc, dt); + task_set(&dt->t, vscsi_devevent_task, dt, NULL); + dt->sc = sc; dt->de = *de; dt->cmd = cmd; @@ -498,10 +500,10 @@ vscsi_devevent(struct vscsi_softc *sc, u_long cmd, } void -vscsi_devevent_task(void *xsc, void *xdt) +vscsi_devevent_task(void *xdt, void *null) { - struct vscsi_softc *sc = xsc; struct vscsi_devevent_task *dt = xdt; + struct vscsi_softc *sc = dt->sc; int state; mtx_enter(&sc->sc_state_mtx); -- 2.20.1