swap_pager.c (132550) | swap_pager.c (133318) |
---|---|
1/* 2 * Copyright (c) 1998 Matthew Dillon, 3 * Copyright (c) 1994 John S. Dyson 4 * Copyright (c) 1990 University of Utah. 5 * Copyright (c) 1982, 1986, 1989, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 53 unchanged lines hidden (view full) --- 62 * 63 * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ 64 * 65 * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94 66 * @(#)vm_swap.c 8.5 (Berkeley) 2/17/94 67 */ 68 69#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 1998 Matthew Dillon, 3 * Copyright (c) 1994 John S. Dyson 4 * Copyright (c) 1990 University of Utah. 5 * Copyright (c) 1982, 1986, 1989, 1993 6 * The Regents of the University of California. All rights reserved. 7 * 8 * This code is derived from software contributed to Berkeley by --- 53 unchanged lines hidden (view full) --- 62 * 63 * from: Utah $Hdr: swap_pager.c 1.4 91/04/30$ 64 * 65 * @(#)swap_pager.c 8.9 (Berkeley) 3/21/94 66 * @(#)vm_swap.c 8.5 (Berkeley) 2/17/94 67 */ 68 69#include <sys/cdefs.h> |
70__FBSDID("$FreeBSD: head/sys/vm/swap_pager.c 132550 2004-07-22 19:44:49Z alc $"); | 70__FBSDID("$FreeBSD: head/sys/vm/swap_pager.c 133318 2004-08-08 07:57:53Z phk $"); |
71 72#include "opt_mac.h" 73#include "opt_swap.h" 74#include "opt_vm.h" 75 76#include <sys/param.h> 77#include <sys/systm.h> 78#include <sys/conf.h> --- 2271 unchanged lines hidden (view full) --- 2350 2351/* 2352 * GEOM backend 2353 * 2354 * Swapping onto disk devices. 2355 * 2356 */ 2357 | 71 72#include "opt_mac.h" 73#include "opt_swap.h" 74#include "opt_vm.h" 75 76#include <sys/param.h> 77#include <sys/systm.h> 78#include <sys/conf.h> --- 2271 unchanged lines hidden (view full) --- 2350 2351/* 2352 * GEOM backend 2353 * 2354 * Swapping onto disk devices. 2355 * 2356 */ 2357 |
2358static g_orphan_t swapgeom_orphan; 2359 |
|
2358static struct g_class g_swap_class = { 2359 .name = "SWAP", | 2360static struct g_class g_swap_class = { 2361 .name = "SWAP", |
2362 .version = G_VERSION, 2363 .orphan = swapgeom_orphan, |
|
2360}; 2361 2362DECLARE_GEOM_CLASS(g_swap_class, g_class); 2363 2364 2365static void 2366swapgeom_done(struct bio *bp2) 2367{ --- 100 unchanged lines hidden (view full) --- 2468 cp = sp->sw_id; 2469 if (cp != NULL && cp->provider == pp) { 2470 mtx_unlock(&sw_dev_mtx); 2471 swh->error = EBUSY; 2472 return; 2473 } 2474 } 2475 mtx_unlock(&sw_dev_mtx); | 2364}; 2365 2366DECLARE_GEOM_CLASS(g_swap_class, g_class); 2367 2368 2369static void 2370swapgeom_done(struct bio *bp2) 2371{ --- 100 unchanged lines hidden (view full) --- 2472 cp = sp->sw_id; 2473 if (cp != NULL && cp->provider == pp) { 2474 mtx_unlock(&sw_dev_mtx); 2475 swh->error = EBUSY; 2476 return; 2477 } 2478 } 2479 mtx_unlock(&sw_dev_mtx); |
2476 if (gp == NULL) { | 2480 if (gp == NULL) |
2477 gp = g_new_geomf(&g_swap_class, "swap", NULL); | 2481 gp = g_new_geomf(&g_swap_class, "swap", NULL); |
2478 gp->orphan = swapgeom_orphan; 2479 } | |
2480 cp = g_new_consumer(gp); 2481 g_attach(cp, pp); 2482 /* 2483 * XXX: Everytime you think you can improve the margin for 2484 * footshooting, somebody depends on the ability to do so: 2485 * savecore(8) wants to write to our swapdev so we cannot 2486 * set an exclusive count :-( 2487 */ --- 115 unchanged lines hidden --- | 2482 cp = g_new_consumer(gp); 2483 g_attach(cp, pp); 2484 /* 2485 * XXX: Everytime you think you can improve the margin for 2486 * footshooting, somebody depends on the ability to do so: 2487 * savecore(8) wants to write to our swapdev so we cannot 2488 * set an exclusive count :-( 2489 */ --- 115 unchanged lines hidden --- |