How to retrieve page pointer from vm_area_struct?

Rajat Sharma fs.rajat at gmail.com
Sun Apr 17 15:22:57 EDT 2011


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 at gmail.com> 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 at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



More information about the Kernelnewbies mailing list