<p>In the Linux kernel, given the <code>task_struct</code>'s <code>mm</code> I can access the process's list of <code>vm_area_struct</code>s. Given these <code>vm_area_struct</code>s, how do I get the <code>struct page</code>s which actually correspond to this vma? </p>

<p>I tried looking for functions in mm/memory.c and the like, but I was at a loss.</p>

<p>Edit: the idea is to find which pages in the vma are currently in memory and which are not. But I <strong>don't</strong> want someone telling me how to do this bit, as that's a small part of a homework assignment that I need to figure out on my own. But I can't seem to figure out how to find the pages that correspond to this vma. If I can find the pages, I figure I can check to see if they have a valid pfn or not.</p>

From your comment to another answer (edit: the other answer seems to have been deleted), it seems you want to read from user space. The function to get the user space pages would be
```
get_user_pages()
```
, but that is most probably not what you want; you probably want
```
copy_from_user
```
/
```
copy_to_user
```
.