]> git.hungrycats.org Git - linux/commitdiff
[PATCH] permit page unmapping if !CONFIG_SWAP
authorAndrew Morton <akpm@digeo.com>
Fri, 28 Mar 2003 11:18:47 +0000 (03:18 -0800)
committerDave Jones <davej@tetrachloride.(none)>
Fri, 28 Mar 2003 11:18:47 +0000 (03:18 -0800)
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.

include/linux/swap.h
mm/vmscan.c

index ab76302894fda039a2376c4e838e55240089cb5c..a2a294961dca1d8163ea7830f453a8681d03da84 100644 (file)
@@ -178,19 +178,18 @@ struct pte_chain *FASTCALL(page_add_rmap(struct page *, pte_t *,
 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 *);
index 914711c81f05f6faa260d547a8f023c6f8961810..407920e2831b21bc504bbb2c98b5412db6b1c68e 100644 (file)
@@ -277,6 +277,7 @@ shrink_list(struct list_head *page_list, unsigned int gfp_mask,
                        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, unsigned int gfp_mask,
                                ; /* try to free the page below */
                        }
                }
-#endif /* CONFIG_SWAP */
                pte_chain_unlock(page);
 
                /*