Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 189835
b: refs/heads/master
c: ea90002
h: refs/heads/master
i:
  189833: be3f894
  189831: 9ee34fa
v: v3
  • Loading branch information
Linus Torvalds committed Apr 13, 2010
1 parent 98099ae commit 39844c1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 646d87b481dab4ba8301716600dfd276605b0ab0
refs/heads/master: ea90002b0fa7bdee86ec22eba1d951f30bf043a6
15 changes: 13 additions & 2 deletions trunk/mm/rmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,9 +734,20 @@ void page_move_anon_rmap(struct page *page,
static void __page_set_anon_rmap(struct page *page,
struct vm_area_struct *vma, unsigned long address)
{
struct anon_vma *anon_vma = vma->anon_vma;
struct anon_vma_chain *avc;
struct anon_vma *anon_vma;

BUG_ON(!vma->anon_vma);

/*
* We must use the _oldest_ possible anon_vma for the page mapping!
*
* So take the last AVC chain entry in the vma, which is the deepest
* ancestor, and use the anon_vma from that.
*/
avc = list_entry(vma->anon_vma_chain.prev, struct anon_vma_chain, same_vma);
anon_vma = avc->anon_vma;

BUG_ON(!anon_vma);
anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON;
page->mapping = (struct address_space *) anon_vma;
page->index = linear_page_index(vma, address);
Expand Down

0 comments on commit 39844c1

Please sign in to comment.