summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>1997-12-02 16:55:53 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>1997-12-02 16:55:53 +0000
commit4c538cb412673a05ec06989196cb98abefa02f27 (patch)
treee4176bfd3ee56479fad3a6ec67a28c36c1666c48
parenta8c3f56779b21653c378de4cbe0b2a84a1d69884 (diff)
Protect some more vnode operation with splbio. Needed for correct interaction
with soft updates code.
-rw-r--r--sys/vm/swap_pager.c4
-rw-r--r--sys/vm/vm_swap.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index d15302ad1e3..65ad9d9a921 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: swap_pager.c,v 1.11 1997/07/25 06:03:04 mickey Exp $ */
+/* $OpenBSD: swap_pager.c,v 1.12 1997/12/02 16:55:51 csapuntz Exp $ */
/* $NetBSD: swap_pager.c,v 1.27 1996/03/16 23:15:20 christos Exp $ */
/*
@@ -722,9 +722,9 @@ swap_pager_io(swp, mlist, npages, flags)
if ((bp->b_flags & B_READ) == 0) {
bp->b_dirtyoff = 0;
bp->b_dirtyend = npages * PAGE_SIZE;
- swapdev_vp->v_numoutput++;
s = splbio();
swp->sw_poip++;
+ swapdev_vp->v_numoutput++;
splx(s);
mask = (~(~0 << npages)) << atop(off);
#ifdef DEBUG
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c
index eb2d6223778..4a8f1026b73 100644
--- a/sys/vm/vm_swap.c
+++ b/sys/vm/vm_swap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_swap.c,v 1.7 1997/11/13 18:35:40 deraadt Exp $ */
+/* $OpenBSD: vm_swap.c,v 1.8 1997/12/02 16:55:52 csapuntz Exp $ */
/* $NetBSD: vm_swap.c,v 1.32 1996/02/05 01:54:09 christos Exp $ */
/*
@@ -171,7 +171,7 @@ void
swstrategy(bp)
register struct buf *bp;
{
- int sz, off, seg, index;
+ int s, sz, off, seg, index;
register struct swdevt *sp;
struct vnode *vp;
@@ -244,6 +244,7 @@ swstrategy(bp)
if ((bp->b_dev = sp->sw_dev) == NODEV && sp->sw_vp->v_type != VREG)
panic("swstrategy");
VHOLD(sp->sw_vp);
+ s = splbio();
if ((bp->b_flags & B_READ) == 0) {
if ((vp = bp->b_vp) != NULL) {
vp->v_numoutput--;
@@ -256,6 +257,7 @@ swstrategy(bp)
}
if (bp->b_vp != NULL)
brelvp(bp);
+ splx(s);
bp->b_vp = sp->sw_vp;
VOP_STRATEGY(bp);
}