geom_kern.c (152784) | geom_kern.c (170307) |
---|---|
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 --- 20 unchanged lines hidden (view full) --- 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 36#include <sys/cdefs.h> | 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 --- 20 unchanged lines hidden (view full) --- 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 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/sys/geom/geom_kern.c 152784 2005-11-25 10:09:30Z le $"); | 37__FBSDID("$FreeBSD: head/sys/geom/geom_kern.c 170307 2007-06-05 00:00:57Z jeff $"); |
38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/kernel.h> 42#include <sys/eventhandler.h> 43#include <sys/malloc.h> 44#include <sys/bio.h> 45#include <sys/sysctl.h> --- 37 unchanged lines hidden (view full) --- 83 84static void 85g_up_procbody(void) 86{ 87 struct proc *p = g_up_proc; 88 struct thread *tp = FIRST_THREAD_IN_PROC(p); 89 90 mtx_assert(&Giant, MA_NOTOWNED); | 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/kernel.h> 42#include <sys/eventhandler.h> 43#include <sys/malloc.h> 44#include <sys/bio.h> 45#include <sys/sysctl.h> --- 37 unchanged lines hidden (view full) --- 83 84static void 85g_up_procbody(void) 86{ 87 struct proc *p = g_up_proc; 88 struct thread *tp = FIRST_THREAD_IN_PROC(p); 89 90 mtx_assert(&Giant, MA_NOTOWNED); |
91 mtx_lock_spin(&sched_lock); | 91 thread_lock(tp); |
92 sched_prio(tp, PRIBIO); | 92 sched_prio(tp, PRIBIO); |
93 mtx_unlock_spin(&sched_lock); | 93 thread_unlock(tp); |
94 for(;;) { 95 g_io_schedule_up(tp); 96 } 97} 98 99static struct kproc_desc g_up_kp = { 100 "g_up", 101 g_up_procbody, --- 4 unchanged lines hidden (view full) --- 106 107static void 108g_down_procbody(void) 109{ 110 struct proc *p = g_down_proc; 111 struct thread *tp = FIRST_THREAD_IN_PROC(p); 112 113 mtx_assert(&Giant, MA_NOTOWNED); | 94 for(;;) { 95 g_io_schedule_up(tp); 96 } 97} 98 99static struct kproc_desc g_up_kp = { 100 "g_up", 101 g_up_procbody, --- 4 unchanged lines hidden (view full) --- 106 107static void 108g_down_procbody(void) 109{ 110 struct proc *p = g_down_proc; 111 struct thread *tp = FIRST_THREAD_IN_PROC(p); 112 113 mtx_assert(&Giant, MA_NOTOWNED); |
114 mtx_lock_spin(&sched_lock); | 114 thread_lock(tp); |
115 sched_prio(tp, PRIBIO); | 115 sched_prio(tp, PRIBIO); |
116 mtx_unlock_spin(&sched_lock); | 116 thread_unlock(tp); |
117 for(;;) { 118 g_io_schedule_down(tp); 119 } 120} 121 122static struct kproc_desc g_down_kp = { 123 "g_down", 124 g_down_procbody, --- 4 unchanged lines hidden (view full) --- 129 130static void 131g_event_procbody(void) 132{ 133 struct proc *p = g_event_proc; 134 struct thread *tp = FIRST_THREAD_IN_PROC(p); 135 136 mtx_assert(&Giant, MA_NOTOWNED); | 117 for(;;) { 118 g_io_schedule_down(tp); 119 } 120} 121 122static struct kproc_desc g_down_kp = { 123 "g_down", 124 g_down_procbody, --- 4 unchanged lines hidden (view full) --- 129 130static void 131g_event_procbody(void) 132{ 133 struct proc *p = g_event_proc; 134 struct thread *tp = FIRST_THREAD_IN_PROC(p); 135 136 mtx_assert(&Giant, MA_NOTOWNED); |
137 mtx_lock_spin(&sched_lock); | 137 thread_lock(tp); |
138 sched_prio(tp, PRIBIO); | 138 sched_prio(tp, PRIBIO); |
139 mtx_unlock_spin(&sched_lock); | 139 thread_unlock(tp); |
140 for(;;) { 141 g_run_events(); 142 tsleep(&g_wait_event, PRIBIO, "-", hz/10); 143 } 144} 145 146static struct kproc_desc g_event_kp = { 147 "g_event", --- 100 unchanged lines hidden --- | 140 for(;;) { 141 g_run_events(); 142 tsleep(&g_wait_event, PRIBIO, "-", hz/10); 143 } 144} 145 146static struct kproc_desc g_event_kp = { 147 "g_event", --- 100 unchanged lines hidden --- |