summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2008-07-25 14:56:48 +0000
committerBob Beck <beck@cvs.openbsd.org>2008-07-25 14:56:48 +0000
commit4488a21781d1010ab7c4833b8ddcc42bb02c2a5f (patch)
treec1345a43c7b94fd8ced867d0b803d7f047cc5be3
parent061a18c7f306027ff65dd9e44eb19d7b6ecb4e05 (diff)
much more correct way of dealing with nfs pending reads/writes
ok thib@
-rw-r--r--sys/nfs/nfs_bio.c15
-rw-r--r--sys/nfs/nfs_vnops.c4
2 files changed, 11 insertions, 8 deletions
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c
index 70e6e3fc398..5abe441c0ed 100644
--- a/sys/nfs/nfs_bio.c
+++ b/sys/nfs/nfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_bio.c,v 1.52 2008/07/23 16:24:43 beck Exp $ */
+/* $OpenBSD: nfs_bio.c,v 1.53 2008/07/25 14:56:47 beck Exp $ */
/* $NetBSD: nfs_bio.c,v 1.25.4.2 1996/07/08 20:47:04 jtc Exp $ */
/*
@@ -607,13 +607,15 @@ nfs_doio(bp, p)
if (bp->b_flags & B_READ) {
uiop->uio_rw = UIO_READ;
nfsstats.read_physios++;
- bcstats.pendingreads++; /* XXX */
+ bcstats.pendingreads++;
+ bcstats.numreads++;
error = nfs_readrpc(vp, uiop);
} else {
iomode = NFSV3WRITE_DATASYNC;
uiop->uio_rw = UIO_WRITE;
nfsstats.write_physios++;
- bcstats.pendingwrites++; /* XXX */
+ bcstats.pendingwrites++;
+ bcstats.numwrites++;
error = nfs_writerpc(vp, uiop, &iomode, &must_commit);
}
if (error) {
@@ -629,6 +631,7 @@ nfs_doio(bp, p)
uiop->uio_offset = ((off_t)bp->b_blkno) << DEV_BSHIFT;
nfsstats.read_bios++;
bcstats.pendingreads++;
+ bcstats.numreads++;
error = nfs_readrpc(vp, uiop);
if (!error) {
bp->b_validoff = 0;
@@ -660,7 +663,8 @@ nfs_doio(bp, p)
case VLNK:
uiop->uio_offset = (off_t)0;
nfsstats.readlink_bios++;
- bcstats.pendingreads++; /* XXX */
+ bcstats.pendingreads++;
+ bcstats.numreads++;
error = nfs_readlinkrpc(vp, uiop, curproc->p_ucred);
break;
default:
@@ -679,7 +683,8 @@ nfs_doio(bp, p)
io.iov_base = (char *)bp->b_data + bp->b_dirtyoff;
uiop->uio_rw = UIO_WRITE;
nfsstats.write_bios++;
- bcstats.pendingwrites++; /* XXX */
+ bcstats.pendingwrites++;
+ bcstats.numwrites++;
if ((bp->b_flags & (B_ASYNC | B_NEEDCOMMIT | B_NOCACHE)) == B_ASYNC)
iomode = NFSV3WRITE_UNSTABLE;
else
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c
index 3227b111f84..bd8471bbc5f 100644
--- a/sys/nfs/nfs_vnops.c
+++ b/sys/nfs/nfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_vnops.c,v 1.97 2008/07/23 17:40:29 deraadt Exp $ */
+/* $OpenBSD: nfs_vnops.c,v 1.98 2008/07/25 14:56:47 beck Exp $ */
/* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */
/*
@@ -2991,8 +2991,6 @@ nfs_writebp(bp, force)
if (retv) {
if (force)
bp->b_flags |= B_WRITEINPROG;
- bcstats.pendingwrites++;
- bcstats.numwrites++;
VOP_STRATEGY(bp);
}