Skip to content

Commit

Permalink
[PATCH] page_add_file_rmap(): remove BUG_ON()s
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Mar 10, 2006
1 parent 6218cf4 commit 85a6cd0
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions mm/rmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 85a6cd0

Please sign in to comment.