use linear_page_index() in mm/mempolicy.c
Subsystems (2)
mm/mempolicy.c is computing linear_page_index() by hand. This teaches alloc_page_vma() to use the pagemap.h helper function for it. This is particularly helpful for when how linear_page_index() is computed changes.
mm/mempolicy.c +1 -3
@@ -668,11 +668,9 @@if (unlikely (pol->policy ==MPOL_INTERLEAVE )) {unsigned nid;if (vma) { -unsigned long off; +unsigned long off =linear_page_index (vma, addr);BUG_ON (addr >= vma->vm_end);BUG_ON (addr < vma->vm_start); - off = vma->vm_pgoff; - off += (addr - vma->vm_start) >>PAGE_SHIFT ; nid =offset_il_node (pol, vma, off); }else {/* fall back to process interleaving */