aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2006-03-09 20:33:34 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-09 22:47:36 -0500
commit85a6cd03a97f04ffff7bfedfa3172894ca9a617b (patch)
tree6dfcb724b0ed7b2cb9b33c0c18933f0d915bc966
parent6218cf4410cfce7bc7e89834e73525b124625d4c (diff)
[PATCH] page_add_file_rmap(): remove BUG_ON()s
Remove two early-development BUG_ONs from page_add_file_rmap. The pfn_valid test (originally useful for checking that nobody passed an artificial struct page) comes too late, since we already have the struct page. The PageAnon test (useful when anon was first distinguished from file rmap) prevents ->nopage implementations from reusing ->mapping, which would otherwise be available. Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--mm/rmap.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index d8ce5ff61454..67f0e20b101f 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -537,9 +537,6 @@ void page_add_new_anon_rmap(struct page *page,
537 */ 537 */
538void page_add_file_rmap(struct page *page) 538void page_add_file_rmap(struct page *page)
539{ 539{
540 BUG_ON(PageAnon(page));
541 BUG_ON(!pfn_valid(page_to_pfn(page)));
542
543 if (atomic_inc_and_test(&page->_mapcount)) 540 if (atomic_inc_and_test(&page->_mapcount))
544 __inc_page_state(nr_mapped); 541 __inc_page_state(nr_mapped);
545} 542}