use get_user_pages, this function works on vma and pin pages in memory as well, typically used by filesystem Direct I/O implementation. Thanks, Rajat On Sun, Apr 17, 2011 at 9:34 AM, Park Chan ho <parkch98@xxxxxxxxx> wrote: > 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 = ??? > } > } > } > > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies@xxxxxxxxxxxxxxxxx > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > _______________________________________________ Kernelnewbies mailing list Kernelnewbies@xxxxxxxxxxxxxxxxx http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies