diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2015-01-02 10:32:22 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2015-01-02 10:32:22 +0000 |
commit | 8f0bc7da5b54937984cfde5d1ca10a8f27041c00 (patch) | |
tree | 8fcd621629c3f9238cd47f0d92d7f1bd05bc0fae | |
parent | 0402bd905a2fd24166fa3c816015d6fb7cf32724 (diff) |
store all state needed to defer probe/detach events in vscsi_devevent_task.
-rw-r--r-- | sys/dev/vscsi.c | 10 |
1 files 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 <dlg@openbsd.org> @@ -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); |