aboutsummaryrefslogtreecommitdiffstats
path: root/mm/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/util.c')
-rw-r--r--mm/util.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/mm/util.c b/mm/util.c
index 16a73195a37b..ab1424dbe2e6 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -6,6 +6,7 @@
6#include <linux/sched.h> 6#include <linux/sched.h>
7#include <linux/security.h> 7#include <linux/security.h>
8#include <linux/swap.h> 8#include <linux/swap.h>
9#include <linux/swapops.h>
9#include <asm/uaccess.h> 10#include <asm/uaccess.h>
10 11
11#include "internal.h" 12#include "internal.h"
@@ -389,9 +390,12 @@ struct address_space *page_mapping(struct page *page)
389 390
390 VM_BUG_ON(PageSlab(page)); 391 VM_BUG_ON(PageSlab(page));
391#ifdef CONFIG_SWAP 392#ifdef CONFIG_SWAP
392 if (unlikely(PageSwapCache(page))) 393 if (unlikely(PageSwapCache(page))) {
393 mapping = &swapper_space; 394 swp_entry_t entry;
394 else 395
396 entry.val = page_private(page);
397 mapping = swap_address_space(entry);
398 } else
395#endif 399#endif
396 if ((unsigned long)mapping & PAGE_MAPPING_ANON) 400 if ((unsigned long)mapping & PAGE_MAPPING_ANON)
397 mapping = NULL; 401 mapping = NULL;