Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/lfs Fix up numoutput accounting.
details: https://anonhg.NetBSD.org/src/rev/8ee485b78e39
branches: trunk
changeset: 748647:8ee485b78e39
user: eeh <eeh%NetBSD.org@localhost>
date: Thu Oct 29 18:20:11 2009 +0000
description:
Fix up numoutput accounting.
diffstat:
sys/ufs/lfs/lfs_vfsops.c | 26 +++++++++-----------------
1 files changed, 9 insertions(+), 17 deletions(-)
diffs (62 lines):
diff -r 3f16e9882490 -r 8ee485b78e39 sys/ufs/lfs/lfs_vfsops.c
--- a/sys/ufs/lfs/lfs_vfsops.c Thu Oct 29 17:17:33 2009 +0000
+++ b/sys/ufs/lfs/lfs_vfsops.c Thu Oct 29 18:20:11 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_vfsops.c,v 1.278 2009/09/13 05:17:37 tsutsui Exp $ */
+/* $NetBSD: lfs_vfsops.c,v 1.279 2009/10/29 18:20:11 eeh Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007, 2007
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.278 2009/09/13 05:17:37 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vfsops.c,v 1.279 2009/10/29 18:20:11 eeh Exp $");
#if defined(_KERNEL_OPT)
#include "opt_lfs.h"
@@ -1678,10 +1678,6 @@
UVMPAGER_MAPIN_WAITOK);
}
- mutex_enter(&vp->v_interlock);
- vp->v_numoutput += 2; /* one for biodone, one for aiodone */
- mutex_exit(&vp->v_interlock);
-
mbp = getiobuf(NULL, true);
UVMHIST_LOG(ubchist, "vp %p mbp %p num now %d bytes 0x%x",
vp, mbp, vp->v_numoutput, bytes);
@@ -1738,9 +1734,14 @@
/* if it's really one i/o, don't make a second buf */
if (offset == startoffset && iobytes == bytes) {
bp = mbp;
- /* correct overcount if there is no second buffer */
+ /*
+ * All the LFS output is done by the segwriter. It
+ * will increment numoutput by one for all the bufs it
+ * recieves. However this buffer needs one extra to
+ * account for aiodone.
+ */
mutex_enter(&vp->v_interlock);
- --vp->v_numoutput;
+ vp->v_numoutput++;
mutex_exit(&vp->v_interlock);
} else {
bp = getiobuf(NULL, true);
@@ -1754,15 +1755,6 @@
* converted this to use nestiobuf --pooka
*/
bp->b_flags &= ~B_ASYNC;
- /*
- * LFS uses VOP_BWRITE instead of VOP_STRATEGY.
- * Therefore biodone doesn't get called for
- * the buffer. Therefore decrement the output
- * counter that nestiobuf_setup() incremented.
- */
- mutex_enter(&vp->v_interlock);
- vp->v_numoutput--;
- mutex_exit(&vp->v_interlock);
}
/* XXX This is silly ... is this necessary? */
Home |
Main Index |
Thread Index |
Old Index