From: Christoph Lameter <christoph@lameter.com>

On Wed, 27 Jul 2005, Andrew Morton wrote:

> Christoph Lameter <christoph@lameter.com> wrote:
> >
> > Could you keep patch #1?
> 
> It breaks ppc64:
> 
> mm/rmap.c: In function `try_to_unmap_one':
> mm/rmap.c:556: error: structure has no member named `mm'
> mm/rmap.c: In function `try_to_unmap_cluster':
> mm/rmap.c:660: error: structure has no member named `mm'
> 
>    pteval = ptep_xchg_flush(vma, address, pte, swp_entry_to_pte(entry));
> 

Oh. PPC64 again....

A problem in the fallback functions. Typically the mm is not used at 
all by the arch specific macros. This should fix it:


Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 include/asm-generic/pgtable.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -puN include/asm-generic/pgtable.h~page-fault-patches-introduce-pte_xchg-and-pte_cmpxchg-fix include/asm-generic/pgtable.h
--- devel/include/asm-generic/pgtable.h~page-fault-patches-introduce-pte_xchg-and-pte_cmpxchg-fix	2005-07-27 15:11:34.000000000 -0700
+++ devel-akpm/include/asm-generic/pgtable.h	2005-07-27 15:11:34.000000000 -0700
@@ -165,13 +165,13 @@ do {				  					  \
 #define ptep_xchg_flush(__vma, __address, __ptep, __pteval)		\
 ({									\
 	pte_t __pte = ptep_clear_flush(__vma, __address, __ptep);	\
-	set_pte_at((__vma)->mm, __address, __ptep, __pteval);		\
+	set_pte_at((__vma)->vm_mm, __address, __ptep, __pteval);		\
 	__pte;								\
 })
 #else
 #define ptep_xchg_flush(__vma, __address, __ptep, __pteval)		\
 ({									\
-	pte_t __pte = ptep_xchg((__vma)->mm, __address, __ptep, __pteval);\
+	pte_t __pte = ptep_xchg((__vma)->vm_mm, __address, __ptep, __pteval);\
 	flush_tlb_page(__vma, __address);				\
 	__pte;								\
 })
_