From: Hugh Dickins <hugh@veritas.com>

Raised #endif CONFIG_SWAP in shrink_list, it was excluding
try_to_unmap of file pages.  Suspect !CONFIG_MMU relied on
that to suppress try_to_unmap, added SWAP_FAIL stub for it.



 25-akpm/include/linux/swap.h |   15 +++++++--------
 25-akpm/mm/vmscan.c          |    2 +-
 2 files changed, 8 insertions(+), 9 deletions(-)

diff -puN include/linux/swap.h~hugh-02-try_to_unmap-CONFIG_SWAP include/linux/swap.h
--- 25/include/linux/swap.h~hugh-02-try_to_unmap-CONFIG_SWAP	Tue Mar 25 18:34:44 2003
+++ 25-akpm/include/linux/swap.h	Tue Mar 25 18:34:44 2003
@@ -178,19 +178,18 @@ struct pte_chain *FASTCALL(page_add_rmap
 void FASTCALL(page_remove_rmap(struct page *, pte_t *));
 int FASTCALL(try_to_unmap(struct page *));
 
-/* return values of try_to_unmap */
-#define	SWAP_SUCCESS	0
-#define	SWAP_AGAIN	1
-#define	SWAP_FAIL	2
-
 /* linux/mm/shmem.c */
 extern int shmem_unuse(swp_entry_t entry, struct page *page);
-
 #else
-#define page_referenced(page) \
-	TestClearPageReferenced(page)
+#define page_referenced(page)	TestClearPageReferenced(page)
+#define try_to_unmap(page)	SWAP_FAIL
 #endif /* CONFIG_MMU */
 
+/* return values of try_to_unmap */
+#define	SWAP_SUCCESS	0
+#define	SWAP_AGAIN	1
+#define	SWAP_FAIL	2
+
 #ifdef CONFIG_SWAP
 /* linux/mm/page_io.c */
 extern int swap_readpage(struct file *, struct page *);
diff -puN mm/vmscan.c~hugh-02-try_to_unmap-CONFIG_SWAP mm/vmscan.c
--- 25/mm/vmscan.c~hugh-02-try_to_unmap-CONFIG_SWAP	Tue Mar 25 18:34:44 2003
+++ 25-akpm/mm/vmscan.c	Tue Mar 25 18:34:44 2003
@@ -277,6 +277,7 @@ shrink_list(struct list_head *page_list,
 			pte_chain_lock(page);
 			mapping = page->mapping;
 		}
+#endif /* CONFIG_SWAP */
 
 		/*
 		 * The page is mapped into the page tables of one or more
@@ -294,7 +295,6 @@ shrink_list(struct list_head *page_list,
 				; /* try to free the page below */
 			}
 		}
-#endif /* CONFIG_SWAP */
 		pte_chain_unlock(page);
 
 		/*

_