diff options
author | Nick Piggin <nickpiggin@yahoo.com.au> | 2005-09-03 18:54:48 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 03:05:43 -0400 |
commit | 4d7670e0f649f9e6e6ea6c8bb9f52441fa00f92b (patch) | |
tree | 52009a96e89a4fe2ff390cd34a7832c89d28f588 /mm/rmap.c | |
parent | 2822c1aa574d277b9ba0130b1e71c1a5874bc04a (diff) |
[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>
Diffstat (limited to 'mm/rmap.c')
-rw-r--r-- | mm/rmap.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -445,16 +445,12 @@ void page_add_anon_rmap(struct page *page, | |||
445 | 445 | ||
446 | if (atomic_inc_and_test(&page->_mapcount)) { | 446 | if (atomic_inc_and_test(&page->_mapcount)) { |
447 | struct anon_vma *anon_vma = vma->anon_vma; | 447 | struct anon_vma *anon_vma = vma->anon_vma; |
448 | pgoff_t index; | ||
449 | 448 | ||
450 | BUG_ON(!anon_vma); | 449 | BUG_ON(!anon_vma); |
451 | anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON; | 450 | anon_vma = (void *) anon_vma + PAGE_MAPPING_ANON; |
452 | page->mapping = (struct address_space *) anon_vma; | 451 | page->mapping = (struct address_space *) anon_vma; |
453 | 452 | ||
454 | index = (address - vma->vm_start) >> PAGE_SHIFT; | 453 | page->index = linear_page_index(vma, address); |
455 | index += vma->vm_pgoff; | ||
456 | index >>= PAGE_CACHE_SHIFT - PAGE_SHIFT; | ||
457 | page->index = index; | ||
458 | 454 | ||
459 | inc_page_state(nr_mapped); | 455 | inc_page_state(nr_mapped); |
460 | } | 456 | } |