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 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 |
2358static g_orphan_t swapgeom_orphan; 2359 |
2360static struct g_class g_swap_class = { 2361 .name = "SWAP", |
2362 .version = G_VERSION, 2363 .orphan = swapgeom_orphan, |
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); |
2480 if (gp == NULL) |
2481 gp = g_new_geomf(&g_swap_class, "swap", NULL); |
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 --- |