summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-12-23 04:56:51 +0000
committerdg <dg@FreeBSD.org>1994-12-23 04:56:51 +0000
commite98518e769d89130026d2207f164cf12c2311d22 (patch)
tree70b59b12c86c5a91cbeb609ae98aee7f93cd8f1c
parentcf154a213447be505c0b2f3e9fde40ad88b8a5ec (diff)
downloadFreeBSD-src-e98518e769d89130026d2207f164cf12c2311d22.zip
FreeBSD-src-e98518e769d89130026d2207f164cf12c2311d22.tar.gz
Initialize b_vnbuf.le_next before returning a new buffer in getpbuf and
trypbuf. Move a couple of splbio's to be slightly less conservative.
-rw-r--r--sys/vm/swap_pager.c8
-rw-r--r--sys/vm/vm_pager.c4
2 files changed, 8 insertions, 4 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 62471ca..89852c0 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -39,7 +39,7 @@
* from: Utah $Hdr: swap_pager.c 1.4 91/04/30$
*
* @(#)swap_pager.c 8.9 (Berkeley) 3/21/94
- * $Id: swap_pager.c,v 1.19 1994/12/19 00:02:54 davidg Exp $
+ * $Id: swap_pager.c,v 1.20 1994/12/22 05:18:12 davidg Exp $
*/
/*
@@ -1020,6 +1020,7 @@ swap_pager_input(swp, m, count, reqpage)
bp = spc->spc_bp;
bzero(bp, sizeof *bp);
bp->b_spc = spc;
+ bp->b_vnbufs.le_next = NOLIST;
} else {
/*
* Get a swap buffer header to perform the IO
@@ -1033,7 +1034,6 @@ swap_pager_input(swp, m, count, reqpage)
*/
pmap_qenter( kva, m, count);
- s = splbio();
bp->b_flags = B_BUSY | B_READ | B_CALL;
bp->b_iodone = swap_pager_iodone1;
bp->b_proc = &proc0; /* XXX (but without B_PHYS set this is ok) */
@@ -1059,6 +1059,7 @@ swap_pager_input(swp, m, count, reqpage)
/*
* wait for the sync I/O to complete
*/
+ s = splbio();
while ((bp->b_flags & B_DONE) == 0) {
tsleep((caddr_t)bp, PVM, "swread", 0);
}
@@ -1388,13 +1389,13 @@ retrygetspace:
--swb[i]->swb_locked;
}
- s = splbio();
/*
* Get a swap buffer header and perform the IO
*/
bp = spc->spc_bp;
bzero(bp, sizeof *bp);
bp->b_spc = spc;
+ bp->b_vnbufs.le_next = NOLIST;
bp->b_flags = B_BUSY;
bp->b_proc = &proc0; /* XXX (but without B_PHYS set this is ok) */
@@ -1415,6 +1416,7 @@ retrygetspace:
* If this is an async write we set up additional buffer fields
* and place a "cleaning" entry on the inuse queue.
*/
+ s = splbio();
if ( flags & B_ASYNC ) {
spc->spc_flags = 0;
spc->spc_swp = swp;
diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c
index 1ecb203..d82ec25 100644
--- a/sys/vm/vm_pager.c
+++ b/sys/vm/vm_pager.c
@@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
- * $Id: vm_pager.c,v 1.8 1994/10/09 01:52:16 phk Exp $
+ * $Id: vm_pager.c,v 1.9 1994/12/19 00:02:56 davidg Exp $
*/
/*
@@ -363,6 +363,7 @@ getpbuf() {
bp->b_rcred = NOCRED;
bp->b_wcred = NOCRED;
bp->b_data = (caddr_t) (MAXPHYS * (bp-swbuf)) + swapbkva;
+ bp->b_vnbufs.le_next = NOLIST;
return bp;
}
@@ -386,6 +387,7 @@ trypbuf() {
bp->b_rcred = NOCRED;
bp->b_wcred = NOCRED;
bp->b_data = (caddr_t) (MAXPHYS * (bp-swbuf)) + swapbkva;
+ bp->b_vnbufs.le_next = NOLIST;
return bp;
}
OpenPOWER on IntegriCloud