Commit cc6a392a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] cleanup page_swap_cache

Removes some redundant BUG checks - trueness of PageSwapCache() implies
that page->mapping is non-NULL, and we've already checked that.
parent aa78091f
...@@ -103,8 +103,6 @@ static void __free_pages_ok (struct page *page, unsigned int order) ...@@ -103,8 +103,6 @@ static void __free_pages_ok (struct page *page, unsigned int order)
BUG(); BUG();
if (!VALID_PAGE(page)) if (!VALID_PAGE(page))
BUG(); BUG();
if (PageSwapCache(page))
BUG();
if (PageLocked(page)) if (PageLocked(page))
BUG(); BUG();
if (PageLRU(page)) if (PageLRU(page))
...@@ -297,8 +295,6 @@ static struct page * balance_classzone(zone_t * classzone, unsigned int gfp_mask ...@@ -297,8 +295,6 @@ static struct page * balance_classzone(zone_t * classzone, unsigned int gfp_mask
BUG(); BUG();
if (!VALID_PAGE(page)) if (!VALID_PAGE(page))
BUG(); BUG();
if (PageSwapCache(page))
BUG();
if (PageLocked(page)) if (PageLocked(page))
BUG(); BUG();
if (PageLRU(page)) if (PageLRU(page))
......
...@@ -96,8 +96,6 @@ void rw_swap_page(int rw, struct page *page) ...@@ -96,8 +96,6 @@ void rw_swap_page(int rw, struct page *page)
PAGE_BUG(page); PAGE_BUG(page);
if (!PageSwapCache(page)) if (!PageSwapCache(page))
PAGE_BUG(page); PAGE_BUG(page);
if (page->mapping != &swapper_space)
PAGE_BUG(page);
if (!rw_swap_page_base(rw, entry, page)) if (!rw_swap_page_base(rw, entry, page))
unlock_page(page); unlock_page(page);
} }
...@@ -113,8 +111,6 @@ void rw_swap_page_nolock(int rw, swp_entry_t entry, char *buf) ...@@ -113,8 +111,6 @@ void rw_swap_page_nolock(int rw, swp_entry_t entry, char *buf)
if (!PageLocked(page)) if (!PageLocked(page))
PAGE_BUG(page); PAGE_BUG(page);
if (PageSwapCache(page))
PAGE_BUG(page);
if (page->mapping) if (page->mapping)
PAGE_BUG(page); PAGE_BUG(page);
/* needs sync_page to wait I/O completation */ /* needs sync_page to wait I/O completation */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment