Module Name: src
Committed By: rmind
Date: Sat May 21 21:26:48 UTC 2011
Modified Files:
src/sys/uvm [rmind-uvmplock]: uvm_fault.c
Log Message:
uvm_fault_lower_promote: fix assert (move a bit up, where logic applies).
To generate a diff of this commit:
cvs rdiff -u -r1.173.2.7 -r1.173.2.8 src/sys/uvm/uvm_fault.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/uvm/uvm_fault.c
diff -u src/sys/uvm/uvm_fault.c:1.173.2.7 src/sys/uvm/uvm_fault.c:1.173.2.8
--- src/sys/uvm/uvm_fault.c:1.173.2.7 Thu May 19 03:43:05 2011
+++ src/sys/uvm/uvm_fault.c Sat May 21 21:26:48 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_fault.c,v 1.173.2.7 2011/05/19 03:43:05 rmind Exp $ */
+/* $NetBSD: uvm_fault.c,v 1.173.2.8 2011/05/21 21:26:48 rmind Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.173.2.7 2011/05/19 03:43:05 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.173.2.8 2011/05/21 21:26:48 rmind Exp $");
#include "opt_uvmhist.h"
@@ -2039,14 +2039,12 @@
int error;
UVMHIST_FUNC("uvm_fault_lower_promote"); UVMHIST_CALLED(maphist);
+ KASSERT(amap != NULL);
+
/*
- * if we are going to promote the data to an anon we
+ * If we are going to promote the data to an anon we
* allocate a blank anon here and plug it into our amap.
*/
-#if DIAGNOSTIC
- if (amap == NULL)
- panic("uvm_fault: want to promote data, but no anon");
-#endif
error = uvmfault_promote(ufi, NULL, uobjpage,
&anon, &flt->anon_spare);
switch (error) {
@@ -2061,8 +2059,9 @@
pg = anon->an_page;
/*
- * fill in the data
+ * Fill in the data.
*/
+ KASSERT(uobj == NULL || (uobjpage->flags & PG_BUSY) != 0);
if (uobjpage != PGO_DONTCARE) {
uvmexp.flt_prcopy++;
@@ -2107,7 +2106,6 @@
anon, pg, 0, 0);
}
- KASSERT(uobj == NULL || (uobjpage->flags & PG_BUSY) != 0);
return uvm_fault_lower_enter(ufi, flt, uobj, anon, pg);
}