Re: What is vma->vm_pgoff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ketan Mukadam wrote:

Hi all,

I am trying to understand a little bit about linux VMM [Writing a device driver for linux].

What is  "unsigned long vm_pgoff;" ?

The comment in the mm.h says that
/* Offset (within vm_file) in PAGE_SIZE units, *not* PAGE_CACHE_SIZE */

But that did not made it clear....tried to 'google' it but to no avail...

can anyone explain me the use of this variable?

I think it's just the offset within the vma region (the relative adress to the beginning of the region if you want)
It is generally used in the driver's mmap implementation as following

unsigned long off = vma->vm_pgoff << PAGE_SHIFT;
This is equal to divide the offest by the number of possible pages. So we get here the offset in pages.

Thanks in advance

Regards
Ketan





--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/




--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux