How to retrieve page pointer from vm_area_struct?

Park Chan ho parkch98 at gmail.com
Sun Apr 17 12:34:01 EDT 2011


Hi all,
I want to retrieve "struct page" pointer from vm_area_struct.
How do I write code below example?

------------example code------------
struct task_struct *p;
struct vm_area_struct *vma;
struct page *page;

for_each_process(p) {
    if (!p->mm) continue;
    for (vma = p->mm->mmap; vma; vma = vma->vm_next) {
       for (i = vma->vm_start; i < vma->vm_end; i += PAGE_SIZE) {
            /* How to get page pointer? */
            page = ???
       }
    }
}



More information about the Kernelnewbies mailing list