Use page_cache_xxx in mm/rmap.c Signed-off-by: Christoph Lameter --- mm/rmap.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) Index: linux-2.6.22-rc6-mm1/mm/rmap.c =================================================================== --- linux-2.6.22-rc6-mm1.orig/mm/rmap.c 2007-07-03 17:19:28.000000000 -0700 +++ linux-2.6.22-rc6-mm1/mm/rmap.c 2007-07-03 17:36:44.000000000 -0700 @@ -188,9 +188,14 @@ static void page_unlock_anon_vma(struct static inline unsigned long vma_address(struct page *page, struct vm_area_struct *vma) { - pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); + pgoff_t pgoff; unsigned long address; + if (PageAnon(page)) + pgoff = page->index; + else + pgoff = page->index << mapping_order(page->mapping); + address = vma->vm_start + ((pgoff - vma->vm_pgoff) << PAGE_SHIFT); if (unlikely(address < vma->vm_start || address >= vma->vm_end)) { /* page should be within any vma from prio_tree_next */ @@ -335,7 +340,7 @@ static int page_referenced_file(struct p { unsigned int mapcount; struct address_space *mapping = page->mapping; - pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); + pgoff_t pgoff = page->index << (page_cache_shift(mapping) - PAGE_SHIFT); struct vm_area_struct *vma; struct prio_tree_iter iter; int referenced = 0; @@ -447,7 +452,7 @@ out: static int page_mkclean_file(struct address_space *mapping, struct page *page) { - pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); + pgoff_t pgoff = page->index << (page_cache_shift(mapping) - PAGE_SHIFT); struct vm_area_struct *vma; struct prio_tree_iter iter; int ret = 0; @@ -863,7 +868,7 @@ static int try_to_unmap_anon(struct page static int try_to_unmap_file(struct page *page, int migration) { struct address_space *mapping = page->mapping; - pgoff_t pgoff = page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT); + pgoff_t pgoff = page->index << (page_cache_shift(mapping) - PAGE_SHIFT); struct vm_area_struct *vma; struct prio_tree_iter iter; int ret = SWAP_AGAIN;