swap: make each swap partition have one address_space
[deliverable/linux.git] / mm / util.c
index 16a73195a37b49741e8d4e778da3dd0e2e4ec178..ab1424dbe2e6c9396ee66ab4446f1bc1cd557382 100644 (file)
--- a/mm/util.c
+++ b/mm/util.c
@@ -6,6 +6,7 @@
 #include <linux/sched.h>
 #include <linux/security.h>
 #include <linux/swap.h>
+#include <linux/swapops.h>
 #include <asm/uaccess.h>
 
 #include "internal.h"
@@ -389,9 +390,12 @@ struct address_space *page_mapping(struct page *page)
 
        VM_BUG_ON(PageSlab(page));
 #ifdef CONFIG_SWAP
-       if (unlikely(PageSwapCache(page)))
-               mapping = &swapper_space;
-       else
+       if (unlikely(PageSwapCache(page))) {
+               swp_entry_t entry;
+
+               entry.val = page_private(page);
+               mapping = swap_address_space(entry);
+       } else
 #endif
        if ((unsigned long)mapping & PAGE_MAPPING_ANON)
                mapping = NULL;
This page took 0.023772 seconds and 5 git commands to generate.