Commit 6d91add09f4bad5f4d4233b13faa392f0c4b16be

Authored by Hugh Dickins
Committed by Linus Torvalds
1 parent 3c1d43787b

mm: add Set,ClearPageSwapCache stubs

If we add NOOP stubs for SetPageSwapCache() and ClearPageSwapCache(), then
we can remove the #ifdef CONFIG_SWAPs from mm/migrate.c.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Acked-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 2 changed files with 1 additions and 4 deletions Side-by-side Diff

include/linux/page-flags.h
... ... @@ -228,6 +228,7 @@
228 228 PAGEFLAG(SwapCache, swapcache)
229 229 #else
230 230 PAGEFLAG_FALSE(SwapCache)
  231 + SETPAGEFLAG_NOOP(SwapCache) CLEARPAGEFLAG_NOOP(SwapCache)
231 232 #endif
232 233  
233 234 #ifdef CONFIG_UNEVICTABLE_LRU
... ... @@ -300,12 +300,10 @@
300 300 * Now we know that no one else is looking at the page.
301 301 */
302 302 get_page(newpage); /* add cache reference */
303   -#ifdef CONFIG_SWAP
304 303 if (PageSwapCache(page)) {
305 304 SetPageSwapCache(newpage);
306 305 set_page_private(newpage, page_private(page));
307 306 }
308   -#endif
309 307  
310 308 radix_tree_replace_slot(pslot, newpage);
311 309  
312 310  
... ... @@ -373,9 +371,7 @@
373 371  
374 372 mlock_migrate_page(newpage, page);
375 373  
376   -#ifdef CONFIG_SWAP
377 374 ClearPageSwapCache(page);
378   -#endif
379 375 ClearPagePrivate(page);
380 376 set_page_private(page, 0);
381 377 /* page->mapping contains a flag for PageAnon() */