Lines Matching refs:vma
756 static void bpf_map_mmap_open(struct vm_area_struct *vma) in bpf_map_mmap_open() argument
758 struct bpf_map *map = vma->vm_file->private_data; in bpf_map_mmap_open()
760 if (vma->vm_flags & VM_MAYWRITE) in bpf_map_mmap_open()
765 static void bpf_map_mmap_close(struct vm_area_struct *vma) in bpf_map_mmap_close() argument
767 struct bpf_map *map = vma->vm_file->private_data; in bpf_map_mmap_close()
769 if (vma->vm_flags & VM_MAYWRITE) in bpf_map_mmap_close()
778 static int bpf_map_mmap(struct file *filp, struct vm_area_struct *vma) in bpf_map_mmap() argument
787 if (!(vma->vm_flags & VM_SHARED)) in bpf_map_mmap()
792 if (vma->vm_flags & VM_WRITE) { in bpf_map_mmap()
809 vma->vm_ops = &bpf_map_default_vmops; in bpf_map_mmap()
810 vma->vm_private_data = map; in bpf_map_mmap()
811 vm_flags_clear(vma, VM_MAYEXEC); in bpf_map_mmap()
812 if (!(vma->vm_flags & VM_WRITE)) in bpf_map_mmap()
814 vm_flags_clear(vma, VM_MAYWRITE); in bpf_map_mmap()
816 err = map->ops->map_mmap(map, vma); in bpf_map_mmap()
820 if (vma->vm_flags & VM_MAYWRITE) in bpf_map_mmap()