summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>1997-12-02 16:58:00 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>1997-12-02 16:58:00 +0000
commit82232fad242af9b522d3f55e8ebda456f534f59d (patch)
treef0fa25ba6484559392706b36c9ded7d2e8f71e5e /sys
parent4c538cb412673a05ec06989196cb98abefa02f27 (diff)
More splbio()'s added so that reassignbuf can do its thing.
Diffstat (limited to 'sys')
-rw-r--r--sys/nfs/nfs_bio.c14
-rw-r--r--sys/nfs/nfs_syscalls.c5
-rw-r--r--sys/nfs/nfs_vnops.c14
3 files changed, 26 insertions, 7 deletions
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c
index 8d5dc377931..8543dc08f2b 100644
--- a/sys/nfs/nfs_bio.c
+++ b/sys/nfs/nfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_bio.c,v 1.13 1997/11/06 05:59:00 csapuntz Exp $ */
+/* $OpenBSD: nfs_bio.c,v 1.14 1997/12/02 16:57:57 csapuntz Exp $ */
/* $NetBSD: nfs_bio.c,v 1.25.4.2 1996/07/08 20:47:04 jtc Exp $ */
/*
@@ -701,7 +701,7 @@ nfs_asyncio(bp, cred)
register struct buf *bp;
struct ucred *cred;
{
- register int i;
+ int i,s;
if (nfs_numasync == 0)
return (EIO);
@@ -741,7 +741,10 @@ nfs_asyncio(bp, cred)
* delayed writes before going back to sleep.
*/
bp->b_flags |= B_DELWRI;
+
+ s = splbio();
reassignbuf(bp, bp->b_vp);
+ splx(s);
biodone(bp);
return (0);
}
@@ -760,7 +763,7 @@ nfs_doio(bp, cr, p)
register struct vnode *vp;
struct nfsnode *np;
struct nfsmount *nmp;
- int error = 0, diff, len, iomode, must_commit = 0;
+ int s, error = 0, diff, len, iomode, must_commit = 0;
struct uio uio;
struct iovec io;
@@ -907,8 +910,11 @@ nfs_doio(bp, cr, p)
* buffer to the clean list, we have to reassign it back to the
* dirty one. Ugh.
*/
- if (bp->b_flags & B_ASYNC)
+ if (bp->b_flags & B_ASYNC) {
+ s = splbio();
reassignbuf(bp, vp);
+ splx(s);
+ }
else if (error)
bp->b_flags |= B_EINTR;
} else {
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index af747ff2b4c..57d1929db52 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_syscalls.c,v 1.11 1997/11/06 05:59:03 csapuntz Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.12 1997/12/02 16:57:58 csapuntz Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
@@ -938,7 +938,6 @@ nfssvc_iod(p)
nbp->b_flags |= (B_BUSY|B_ASYNC);
break;
}
- splx(s);
/*
* For the delayed write, do the first part of nfs_bwrite()
* up to, but not including nfs_strategy().
@@ -948,6 +947,8 @@ nfssvc_iod(p)
reassignbuf(nbp, nbp->b_vp);
nbp->b_vp->v_numoutput++;
}
+ splx(s);
+
(void) nfs_doio(bp, bp->b_wcred, (struct proc *)0);
} while ((bp = nbp) != NULL);
}
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 0307dab64d3..76cb0d40c1d 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vnops.c,v 1.18 1997/11/06 05:59:05 csapuntz Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.19 1997/12/02 16:57:59 csapuntz Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
@@ -2810,11 +2810,13 @@ again:
if (retv)
brelse(bp);
else {
+ s = splbio();
vp->v_numoutput++;
bp->b_flags |= B_ASYNC;
bp->b_flags &= ~(B_READ|B_DONE|B_ERROR|B_DELWRI);
bp->b_dirtyoff = bp->b_dirtyend = 0;
reassignbuf(bp, vp);
+ splx(s);
biodone(bp);
}
}
@@ -2863,19 +2865,24 @@ loop:
goto again;
}
if (waitfor == MNT_WAIT) {
+ s = splbio();
while (vp->v_numoutput) {
vp->v_flag |= VBWAIT;
error = tsleep((caddr_t)&vp->v_numoutput,
slpflag | (PRIBIO + 1), "nfsfsync", slptimeo);
if (error) {
+ splx(s);
if (nfs_sigintr(nmp, (struct nfsreq *)0, p))
return (EINTR);
if (slpflag == PCATCH) {
slpflag = 0;
slptimeo = 2 * hz;
}
+ s = splbio();
}
}
+ splx(s);
+
if (vp->v_dirtyblkhd.lh_first && commit) {
#if 0
vprint("nfs_fsync: dirty", vp);
@@ -3081,6 +3088,7 @@ nfs_writebp(bp, force)
register int oldflags = bp->b_flags, retv = 1;
register struct proc *p = curproc; /* XXX */
off_t off;
+ int s;
if(!(bp->b_flags & B_BUSY))
panic("bwrite: buffer is not busy???");
@@ -3092,6 +3100,7 @@ nfs_writebp(bp, force)
#endif
bp->b_flags &= ~(B_READ|B_DONE|B_ERROR|B_DELWRI);
+ s = splbio();
if (oldflags & B_ASYNC) {
if (oldflags & B_DELWRI) {
reassignbuf(bp, bp->b_vp);
@@ -3100,6 +3109,7 @@ nfs_writebp(bp, force)
}
}
bp->b_vp->v_numoutput++;
+ splx(s);
/*
* If B_NEEDCOMMIT is set, a commit rpc may do the trick. If not
@@ -3128,7 +3138,9 @@ nfs_writebp(bp, force)
if( (oldflags & B_ASYNC) == 0) {
int rtval = biowait(bp);
if (oldflags & B_DELWRI) {
+ s = splbio();
reassignbuf(bp, bp->b_vp);
+ splx(s);
} else if (p) {
++p->p_stats->p_ru.ru_oublock;
}