summaryrefslogtreecommitdiff
path: root/mm/rmap.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2010-10-22 19:40:48 +0400
committerAndi Kleen <ak@linux.intel.com>2010-10-22 19:40:48 +0400
commit46e387bbd82d438b9131e237e6e2cb55a825da49 (patch)
tree414948afd6b4d63c6ea8cc79ce022128bc1bf2eb /mm/rmap.c
parente9d08567ef72a2d0fb9b14dded386352d3136442 (diff)
parent3ef8fd7f720fc4f462fcdcae2fcde6f1c0536bfe (diff)
downloadlinux-46e387bbd82d438b9131e237e6e2cb55a825da49.tar.xz
Merge branch 'hwpoison-hugepages' into hwpoison
Conflicts: mm/memory-failure.c
Diffstat (limited to 'mm/rmap.c')
-rw-r--r--mm/rmap.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/mm/rmap.c b/mm/rmap.c
index 92e6757f196e..8adc6e3b09b3 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -780,10 +780,10 @@ void page_move_anon_rmap(struct page *page,
}
/**
- * __page_set_anon_rmap - setup new anonymous rmap
- * @page: the page to add the mapping to
- * @vma: the vm area in which the mapping is added
- * @address: the user virtual address mapped
+ * __page_set_anon_rmap - set up new anonymous rmap
+ * @page: Page to add to rmap
+ * @vma: VM area to add page to.
+ * @address: User virtual address of the mapping
* @exclusive: the page is exclusively owned by the current process
*/
static void __page_set_anon_rmap(struct page *page,
@@ -793,25 +793,16 @@ static void __page_set_anon_rmap(struct page *page,
BUG_ON(!anon_vma);
+ if (PageAnon(page))
+ return;
+
/*
* If the page isn't exclusively mapped into this vma,
* we must use the _oldest_ possible anon_vma for the
* page mapping!
*/
- if (!exclusive) {
- if (PageAnon(page))
- return;
+ if (!exclusive)
anon_vma = anon_vma->root;
- } else {
- /*
- * In this case, swapped-out-but-not-discarded swap-cache
- * is remapped. So, no need to update page->mapping here.
- * We convice anon_vma poitned by page->mapping is not obsolete
- * because vma->anon_vma is necessary to be a family of it.
- */
- if (PageAnon(page))
- return;
- }
anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON;
page->mapping = (struct address_space *) anon_vma;