I am trying to understand how mmap works. User level call of mmap looks like below.
void *mmap(void *addr, size_t len, int prot, int flags,
int fildes, off_t off);
but kernel level mmap for a particular device driver looks like:
int <device_name>_mmap(struct file*fp, struct vm_area_struct *vma)
I also looked at the source code but I am not able to find the connection in between.
How does mmap for particular device gets its arguments "struct vm_area_struct *vma" ? Can you please help me understand that ? Appreciate your help.