Deleted Added
full compact
swap_pager.c (44739) swap_pager.c (46580)
1/*
2 * Copyright (c) 1998 Matthew Dillon,
3 * Copyright (c) 1994 John S. Dyson
4 * Copyright (c) 1990 University of Utah.
5 * Copyright (c) 1991, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by

--- 50 unchanged lines hidden (view full) ---

59 * cycled (in a high-load system) by the pager. We also do on-the-fly
60 * removal of invalidated swap blocks when a page is destroyed
61 * or renamed.
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 *
1/*
2 * Copyright (c) 1998 Matthew Dillon,
3 * Copyright (c) 1994 John S. Dyson
4 * Copyright (c) 1990 University of Utah.
5 * Copyright (c) 1991, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * This code is derived from software contributed to Berkeley by

--- 50 unchanged lines hidden (view full) ---

59 * cycled (in a high-load system) by the pager. We also do on-the-fly
60 * removal of invalidated swap blocks when a page is destroyed
61 * or renamed.
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 *
67 * $Id: swap_pager.c,v 1.116 1999/02/21 08:34:15 dillon Exp $
67 * $Id: swap_pager.c,v 1.117 1999/03/14 09:20:00 julian Exp $
68 */
69
70#include <sys/param.h>
71#include <sys/systm.h>
72#include <sys/kernel.h>
73#include <sys/proc.h>
74#include <sys/buf.h>
75#include <sys/vnode.h>

--- 1029 unchanged lines hidden (view full) ---

1105 *
1106 * NOTE: B_PAGING is set by pbgetvp()
1107 */
1108
1109 pmap_qenter(kva, m + i, j - i);
1110
1111 bp->b_flags = B_BUSY | B_READ | B_CALL;
1112 bp->b_iodone = swp_pager_async_iodone;
68 */
69
70#include <sys/param.h>
71#include <sys/systm.h>
72#include <sys/kernel.h>
73#include <sys/proc.h>
74#include <sys/buf.h>
75#include <sys/vnode.h>

--- 1029 unchanged lines hidden (view full) ---

1105 *
1106 * NOTE: B_PAGING is set by pbgetvp()
1107 */
1108
1109 pmap_qenter(kva, m + i, j - i);
1110
1111 bp->b_flags = B_BUSY | B_READ | B_CALL;
1112 bp->b_iodone = swp_pager_async_iodone;
1113 bp->b_proc = &proc0; /* XXX (but without B_PHYS set this is ok) */
1114 bp->b_rcred = bp->b_wcred = bp->b_proc->p_ucred;
1113 bp->b_rcred = bp->b_wcred = proc0.p_ucred;
1115 bp->b_data = (caddr_t) kva;
1116 crhold(bp->b_rcred);
1117 crhold(bp->b_wcred);
1118 /*
1119 * b_blkno is in page-sized chunks. swapblk is valid, too, so
1120 * we don't have to mask it against SWAPBLK_MASK.
1121 */
1122 bp->b_blkno = blk - (reqpage - i);

--- 240 unchanged lines hidden (view full) ---

1363 } else {
1364 bp = getpbuf(&nsw_wcount_async);
1365 bp->b_flags = B_BUSY | B_CALL | B_ASYNC;
1366 }
1367 bp->b_spc = NULL; /* not used, but NULL-out anyway */
1368
1369 pmap_qenter((vm_offset_t)bp->b_data, &m[i], n);
1370
1114 bp->b_data = (caddr_t) kva;
1115 crhold(bp->b_rcred);
1116 crhold(bp->b_wcred);
1117 /*
1118 * b_blkno is in page-sized chunks. swapblk is valid, too, so
1119 * we don't have to mask it against SWAPBLK_MASK.
1120 */
1121 bp->b_blkno = blk - (reqpage - i);

--- 240 unchanged lines hidden (view full) ---

1362 } else {
1363 bp = getpbuf(&nsw_wcount_async);
1364 bp->b_flags = B_BUSY | B_CALL | B_ASYNC;
1365 }
1366 bp->b_spc = NULL; /* not used, but NULL-out anyway */
1367
1368 pmap_qenter((vm_offset_t)bp->b_data, &m[i], n);
1369
1371 bp->b_proc = &proc0; /* XXX (but without B_PHYS this is ok) */
1372 bp->b_rcred = bp->b_wcred = bp->b_proc->p_ucred;
1370 bp->b_rcred = bp->b_wcred = proc0.p_ucred;
1373 bp->b_bcount = PAGE_SIZE * n;
1374 bp->b_bufsize = PAGE_SIZE * n;
1375 bp->b_blkno = blk;
1376
1377 crhold(bp->b_rcred);
1378 crhold(bp->b_wcred);
1379
1380 pbgetvp(swapdev_vp, bp);

--- 638 unchanged lines hidden ---
1371 bp->b_bcount = PAGE_SIZE * n;
1372 bp->b_bufsize = PAGE_SIZE * n;
1373 bp->b_blkno = blk;
1374
1375 crhold(bp->b_rcred);
1376 crhold(bp->b_wcred);
1377
1378 pbgetvp(swapdev_vp, bp);

--- 638 unchanged lines hidden ---