geom_kern.c (112988) | geom_kern.c (113926) |
---|---|
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_kern.c 112988 2003-04-02 20:41:18Z phk $ | 35 * $FreeBSD: head/sys/geom/geom_kern.c 113926 2003-04-23 19:15:27Z phk $ |
36 */ 37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/kernel.h> | 36 */ 37 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/kernel.h> |
41#include <sys/eventhandler.h> |
|
41#include <sys/malloc.h> 42#include <sys/bio.h> 43#include <sys/sysctl.h> 44#include <sys/proc.h> 45#include <sys/kthread.h> 46#include <sys/lock.h> 47#include <sys/mutex.h> 48#include <sys/sx.h> --- 4 unchanged lines hidden (view full) --- 53MALLOC_DEFINE(M_GEOM, "GEOM", "Geom data structures"); 54 55struct sx topology_lock; 56 57static struct proc *g_up_proc; 58 59int g_debugflags; 60int g_collectstats = 1; | 42#include <sys/malloc.h> 43#include <sys/bio.h> 44#include <sys/sysctl.h> 45#include <sys/proc.h> 46#include <sys/kthread.h> 47#include <sys/lock.h> 48#include <sys/mutex.h> 49#include <sys/sx.h> --- 4 unchanged lines hidden (view full) --- 54MALLOC_DEFINE(M_GEOM, "GEOM", "Geom data structures"); 55 56struct sx topology_lock; 57 58static struct proc *g_up_proc; 59 60int g_debugflags; 61int g_collectstats = 1; |
62int g_shutdown; |
|
61 62/* 63 * G_UP and G_DOWN are the two threads which push I/O through the 64 * stack. 65 * 66 * Things are procesed in a FIFO order, but these threads could be 67 * part of I/O prioritization by deciding which bios/bioqs to service 68 * in what order. --- 65 unchanged lines hidden (view full) --- 134} 135 136struct kproc_desc g_event_kp = { 137 "g_event", 138 g_event_procbody, 139 &g_event_proc, 140}; 141 | 63 64/* 65 * G_UP and G_DOWN are the two threads which push I/O through the 66 * stack. 67 * 68 * Things are procesed in a FIFO order, but these threads could be 69 * part of I/O prioritization by deciding which bios/bioqs to service 70 * in what order. --- 65 unchanged lines hidden (view full) --- 136} 137 138struct kproc_desc g_event_kp = { 139 "g_event", 140 g_event_procbody, 141 &g_event_proc, 142}; 143 |
144static void 145geom_shutdown(void *foo __unused) 146{ 147 148 g_shutdown = 1; 149} 150 |
|
142void 143g_init(void) 144{ 145 sx_init(&topology_lock, "GEOM topology"); 146 g_io_init(); 147 g_event_init(); 148 g_ctl_init(); 149 mtx_lock(&Giant); 150 kproc_start(&g_event_kp); 151 kproc_start(&g_up_kp); 152 kproc_start(&g_down_kp); 153 mtx_unlock(&Giant); | 151void 152g_init(void) 153{ 154 sx_init(&topology_lock, "GEOM topology"); 155 g_io_init(); 156 g_event_init(); 157 g_ctl_init(); 158 mtx_lock(&Giant); 159 kproc_start(&g_event_kp); 160 kproc_start(&g_up_kp); 161 kproc_start(&g_down_kp); 162 mtx_unlock(&Giant); |
163 EVENTHANDLER_REGISTER(shutdown_pre_sync, geom_shutdown, NULL, 164 SHUTDOWN_PRI_FIRST); |
|
154} 155 156static int 157sysctl_kern_geom_conftxt(SYSCTL_HANDLER_ARGS) 158{ 159 int error; 160 struct sbuf *sb; 161 --- 77 unchanged lines hidden --- | 165} 166 167static int 168sysctl_kern_geom_conftxt(SYSCTL_HANDLER_ARGS) 169{ 170 int error; 171 struct sbuf *sb; 172 --- 77 unchanged lines hidden --- |