diff options
author | Joonsoo Kim <iamjoonsoo.kim@lge.com> | 2013-09-11 17:21:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 18:57:31 -0400 |
commit | d2cf5ad6312ca9913464fac40fb47ba47ad945c4 (patch) | |
tree | 05590c6fed5ee9b86b65e1c23a899e921faeb040 /mm/util.c | |
parent | bc4b4448dba660afc8df3790564320302d9709a1 (diff) |
swap: clean-up #ifdef in page_mapping()
PageSwapCache() is always false when !CONFIG_SWAP, so compiler
properly discard related code. Therefore, we don't need #ifdef explicitly.
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/util.c')
-rw-r--r-- | mm/util.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -388,15 +388,12 @@ struct address_space *page_mapping(struct page *page) | |||
388 | struct address_space *mapping = page->mapping; | 388 | struct address_space *mapping = page->mapping; |
389 | 389 | ||
390 | VM_BUG_ON(PageSlab(page)); | 390 | VM_BUG_ON(PageSlab(page)); |
391 | #ifdef CONFIG_SWAP | ||
392 | if (unlikely(PageSwapCache(page))) { | 391 | if (unlikely(PageSwapCache(page))) { |
393 | swp_entry_t entry; | 392 | swp_entry_t entry; |
394 | 393 | ||
395 | entry.val = page_private(page); | 394 | entry.val = page_private(page); |
396 | mapping = swap_address_space(entry); | 395 | mapping = swap_address_space(entry); |
397 | } else | 396 | } else if ((unsigned long)mapping & PAGE_MAPPING_ANON) |
398 | #endif | ||
399 | if ((unsigned long)mapping & PAGE_MAPPING_ANON) | ||
400 | mapping = NULL; | 397 | mapping = NULL; |
401 | return mapping; | 398 | return mapping; |
402 | } | 399 | } |