kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: fs.rajat@gmail.com (Rajat Sharma)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How to retrieve page pointer from vm_area_struct?
Date: Sun, 17 Apr 2011 12:22:57 -0700	[thread overview]
Message-ID: <BANLkTinc85DDpO0H++W2Tau6V2t5CU8+sw@mail.gmail.com> (raw)
In-Reply-To: <BANLkTim1mCV4bm2wtZbgoWsTekYjL7onpA@mail.gmail.com>

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@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
>

      reply	other threads:[~2011-04-17 19:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-17 16:34 How to retrieve page pointer from vm_area_struct? Park Chan ho
2011-04-17 19:22 ` Rajat Sharma [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTinc85DDpO0H++W2Tau6V2t5CU8+sw@mail.gmail.com \
    --to=fs.rajat@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).