diff options
| author | 2009-03-23 15:10:44 +0000 | |
|---|---|---|
| committer | 2009-03-23 15:10:44 +0000 | |
| commit | 34852b00d3854da3a080c5876e61a2327ec53b54 (patch) | |
| tree | 28b3a66f6bd9e5d69f92d611e822b504f006eb31 /sys/kern/vfs_bio.c | |
| parent | add rlog -d support, ported from openrcs by (diff) | |
| download | wireguard-openbsd-34852b00d3854da3a080c5876e61a2327ec53b54.tar.xz wireguard-openbsd-34852b00d3854da3a080c5876e61a2327ec53b54.zip | |
fix buffer cache pending writs statistic so it does not go negative.
this ensures we ignore counting any buffers returning through biodone()
for which B_PHYS has been set - which should be set on all transfers
that manually do raw io bypassing the buffer cache by setting up their
own buffer and calling strategy..
ok thib@, todd@, and now that he is a buffer cache and nfs hacker oga@
Diffstat (limited to 'sys/kern/vfs_bio.c')
| -rw-r--r-- | sys/kern/vfs_bio.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 6892c6a560e..a2ed79f97f4 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_bio.c,v 1.110 2009/01/11 17:40:00 oga Exp $ */ +/* $OpenBSD: vfs_bio.c,v 1.111 2009/03/23 15:10:44 beck Exp $ */ /* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */ /*- @@ -1156,12 +1156,15 @@ biodone(struct buf *bp) if (!ISSET(bp->b_flags, B_READ)) { CLR(bp->b_flags, B_WRITEINPROG); - bcstats.pendingwrites--; vwakeup(bp->b_vp); - } else if (bcstats.numbufs && - (!(ISSET(bp->b_flags, B_RAW) || ISSET(bp->b_flags, B_PHYS)))) - bcstats.pendingreads--; - + } + if (bcstats.numbufs && + (!(ISSET(bp->b_flags, B_RAW) || ISSET(bp->b_flags, B_PHYS)))) { + if (!ISSET(bp->b_flags, B_READ)) + bcstats.pendingwrites--; + else + bcstats.pendingreads--; + } if (ISSET(bp->b_flags, B_CALL)) { /* if necessary, call out */ CLR(bp->b_flags, B_CALL); /* but note callout done */ (*bp->b_iodone)(bp); |
