From: Hugh Dickins Date: Fri, 10 Mar 2006 01:33:34 +0000 (-0800) Subject: [PATCH] page_add_file_rmap(): remove BUG_ON()s X-Git-Tag: v2.6.16-rc6~45 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=85a6cd03a97f04ffff7bfedfa3172894ca9a617b;p=~shefty%2Frdma-dev.git [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/rmap.c b/mm/rmap.c index d8ce5ff6145..67f0e20b101 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -537,9 +537,6 @@ void page_add_new_anon_rmap(struct page *page, */ void page_add_file_rmap(struct page *page) { - BUG_ON(PageAnon(page)); - BUG_ON(!pfn_valid(page_to_pfn(page))); - if (atomic_inc_and_test(&page->_mapcount)) __inc_page_state(nr_mapped); }