On Tue, 5 Feb 2013 15:03:39 +0800Just as Hocko said, the unmap_ref_private() (in hugetlb.c) may also uses the __linear_page_index().
Huang Shijie<b32955@xxxxxxxxxxxxx> wrote:
+static inline pgoff_t __linear_page_index(struct vm_area_struct *vma,I don't think we need bother creating both linear_page_index() and
unsigned long address)
{
pgoff_t pgoff;
+
+ pgoff = (address - vma->vm_start)>> PAGE_SHIFT;
+ return pgoff + vma->vm_pgoff;
+}
+
+static inline pgoff_t linear_page_index(struct vm_area_struct *vma,
+ unsigned long address)
+{
if (unlikely(is_vm_hugetlb_page(vma)))
return linear_hugepage_index(vma, address);
- pgoff = (address - vma->vm_start)>> PAGE_SHIFT;
- pgoff += vma->vm_pgoff;
- return pgoff>> (PAGE_CACHE_SHIFT - PAGE_SHIFT);
+ return __linear_page_index(vma, address)>>
+ (PAGE_CACHE_SHIFT - PAGE_SHIFT);
}
__linear_page_index(). Realistically, we won't be supporting