Patch from Dave McCracken <dmccr@us.ibm.com>

Ok, the vm_ops->nopage function is set in drivers like drm and agp.  I don't
think it's reasonable to require all of them to set PageAnon.  So here's a
patch that tests the page on do_no_page and sets the flag appropriately.



 mm/memory.c |    4 ++++
 1 files changed, 4 insertions(+)

diff -puN mm/memory.c~objrmap-X-fix mm/memory.c
--- 25/mm/memory.c~objrmap-X-fix	Tue Feb 25 15:22:06 2003
+++ 25-akpm/mm/memory.c	Tue Feb 25 15:22:06 2003
@@ -1323,6 +1323,10 @@ do_no_page(struct mm_struct *mm, struct 
 	if (!pte_chain)
 		goto oom;
 
+	/* See if nopage returned an anon page */
+	if (!new_page->mapping || PageSwapCache(new_page))
+		SetPageAnon(new_page);
+
 	/*
 	 * Should we do an early C-O-W break?
 	 */

_