Lines Matching refs:vma
91 static void shm_open(struct vm_area_struct *vma);
92 static void shm_close(struct vm_area_struct *vma);
271 static int __shm_open(struct vm_area_struct *vma)
273 struct file *file = vma->vm_file;
296 static void shm_open(struct vm_area_struct *vma)
298 int err = __shm_open(vma);
353 * remove the attach descriptor vma.
358 static void shm_close(struct vm_area_struct *vma)
360 struct file *file = vma->vm_file;
519 struct file *file = vmf->vma->vm_file;
525 static int shm_split(struct vm_area_struct *vma, unsigned long addr)
527 struct file *file = vma->vm_file;
531 return sfd->vm_ops->split(vma, addr);
537 static unsigned long shm_pagesize(struct vm_area_struct *vma)
539 struct file *file = vma->vm_file;
543 return sfd->vm_ops->pagesize(vma);
550 static int shm_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
552 struct file *file = vma->vm_file;
557 err = sfd->vm_ops->set_policy(vma, new);
562 static struct mempolicy *shm_get_policy(struct vm_area_struct *vma, unsigned long addr)
564 struct file *file = vma->vm_file;
569 pol = sfd->vm_ops->get_policy(vma, addr);
570 } else if (vma->vm_policy) {
571 pol = vma->vm_policy;
578 static int shm_mmap(struct file *file, struct vm_area_struct *vma)
588 ret = __shm_open(vma);
593 ret = call_mmap(sfd->file, vma);
595 shm_close(vma);
598 sfd->vm_ops = vma->vm_ops;
602 vma->vm_ops = &shm_vm_ops;
1750 struct vm_area_struct *vma;
1771 * unmapped: It searches for a vma that is backed by shm and that
1779 * a part of a vma. Both calls in this function are for full vmas,
1780 * the parameters are directly copied from the vma itself and always
1785 * match the usual checks anyway. So assume all vma's are
1788 vma = find_vma(mm, addr);
1791 while (vma) {
1792 next = vma->vm_next;
1799 if ((vma->vm_ops == &shm_vm_ops) && (vma->vm_start - addr) / PAGE_SIZE == vma->vm_pgoff) {
1807 file = vma->vm_file;
1808 size = i_size_read(file_inode(vma->vm_file));
1809 do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start, NULL);
1814 * searching for matching vma's.
1817 vma = next;
1820 vma = next;
1829 while (vma && (loff_t)(vma->vm_end - addr) <= size) {
1830 next = vma->vm_next;
1832 /* finding a matching vma now does not alter retval */
1833 if ((vma->vm_ops == &shm_vm_ops) && ((vma->vm_start - addr) / PAGE_SIZE == vma->vm_pgoff) &&
1834 (vma->vm_file == file)) {
1835 do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start, NULL);
1837 vma = next;
1844 if (vma && vma->vm_start == addr && vma->vm_ops == &shm_vm_ops) {
1845 do_munmap(mm, vma->vm_start, vma->vm_end - vma->vm_start, NULL);