Commit 4d7670e0f649f9e6e6ea6c8bb9f52441fa00f92b

Authored by Nick Piggin
Committed by Linus Torvalds
1 parent 2822c1aa57

[PATCH] mm: cleanup rmap

Thanks to Bill Irwin for pointing this out.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 1 additions and 5 deletions Side-by-side Diff

... ... @@ -445,16 +445,12 @@
445 445  
446 446 if (atomic_inc_and_test(&page->_mapcount)) {
447 447 struct anon_vma *anon_vma = vma->anon_vma;
448   - pgoff_t index;
449 448  
450 449 BUG_ON(!anon_vma);
451 450 anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON;
452 451 page->mapping = (struct address_space *) anon_vma;
453 452  
454   - index = (address - vma->vm_start) >> PAGE_SHIFT;
455   - index += vma->vm_pgoff;
456   - index >>= PAGE_CACHE_SHIFT - PAGE_SHIFT;
457   - page->index = index;
  453 + page->index = linear_page_index(vma, address);
458 454  
459 455 inc_page_state(nr_mapped);
460 456 }