• Home
  • Raw
  • Download

Lines Matching refs:file

130 		struct file *file, struct address_space *mapping)  in __remove_shared_vm_struct()  argument
133 atomic_inc(&file_inode(file)->i_writecount); in __remove_shared_vm_struct()
148 struct file *file = vma->vm_file; in unlink_file_vma() local
150 if (file) { in unlink_file_vma()
151 struct address_space *mapping = file->f_mapping; in unlink_file_vma()
153 __remove_shared_vm_struct(vma, file, mapping); in unlink_file_vma()
573 struct file *file; in __vma_link_file() local
575 file = vma->vm_file; in __vma_link_file()
576 if (file) { in __vma_link_file()
577 struct address_space *mapping = file->f_mapping; in __vma_link_file()
580 atomic_dec(&file_inode(file)->i_writecount); in __vma_link_file()
685 struct file *file = vma->vm_file; in __vma_adjust() local
712 VM_WARN_ON(file != next->vm_file); in __vma_adjust()
777 if (file) { in __vma_adjust()
778 mapping = file->f_mapping; in __vma_adjust()
855 if (file) in __vma_adjust()
856 __remove_shared_vm_struct(next, file, mapping); in __vma_adjust()
892 if (file) { in __vma_adjust()
894 fput(file); in __vma_adjust()
957 if (insert && file) in __vma_adjust()
970 struct file *file, unsigned long vm_flags, in is_mergeable_vma() argument
984 if (vma->vm_file != file) in is_mergeable_vma()
1022 struct anon_vma *anon_vma, struct file *file, in can_vma_merge_before() argument
1027 if (is_mergeable_vma(vma, file, vm_flags, vm_userfaultfd_ctx, anon_name) && in can_vma_merge_before()
1044 struct anon_vma *anon_vma, struct file *file, in can_vma_merge_after() argument
1049 if (is_mergeable_vma(vma, file, vm_flags, vm_userfaultfd_ctx, anon_name) && in can_vma_merge_after()
1102 struct anon_vma *anon_vma, struct file *file, in vma_merge() argument
1137 anon_vma, file, pgoff, in vma_merge()
1146 anon_vma, file, in vma_merge()
1171 anon_vma, file, pgoff+pglen, in vma_merge()
1322 static inline u64 file_mmap_size_max(struct file *file, struct inode *inode) in file_mmap_size_max() argument
1331 if (file->f_mode & FMODE_UNSIGNED_OFFSET) in file_mmap_size_max()
1338 static inline bool file_mmap_ok(struct file *file, struct inode *inode, in file_mmap_ok() argument
1341 u64 maxsize = file_mmap_size_max(file, inode); in file_mmap_ok()
1354 unsigned long do_mmap(struct file *file, unsigned long addr, in do_mmap() argument
1375 if (!(file && path_noexec(&file->f_path))) in do_mmap()
1397 addr = get_unmapped_area(file, addr, len, pgoff, flags); in do_mmap()
1421 if (file) { in do_mmap()
1422 struct inode *inode = file_inode(file); in do_mmap()
1424 if (!file_mmap_ok(file, inode, pgoff, len)) in do_mmap()
1429 if ((prot&PROT_WRITE) && !(file->f_mode&FMODE_WRITE)) in do_mmap()
1436 if (IS_APPEND(inode) && (file->f_mode & FMODE_WRITE)) in do_mmap()
1442 if (locks_verify_locked(file)) in do_mmap()
1446 if (!(file->f_mode & FMODE_WRITE)) in do_mmap()
1451 if (!(file->f_mode & FMODE_READ)) in do_mmap()
1453 if (path_noexec(&file->f_path)) { in do_mmap()
1459 if (!file->f_op->mmap) in do_mmap()
1500 if (file && is_file_hugepages(file)) in do_mmap()
1504 addr = mmap_region(file, addr, len, vm_flags, pgoff, uf); in do_mmap()
1516 struct file *file = NULL; in SYSCALL_DEFINE6() local
1521 file = fget(fd); in SYSCALL_DEFINE6()
1522 if (!file) in SYSCALL_DEFINE6()
1524 if (is_file_hugepages(file)) in SYSCALL_DEFINE6()
1525 len = ALIGN(len, huge_page_size(hstate_file(file))); in SYSCALL_DEFINE6()
1527 if (unlikely(flags & MAP_HUGETLB && !is_file_hugepages(file))) in SYSCALL_DEFINE6()
1544 file = hugetlb_file_setup(HUGETLB_ANON_FILE, len, in SYSCALL_DEFINE6()
1548 if (IS_ERR(file)) in SYSCALL_DEFINE6()
1549 return PTR_ERR(file); in SYSCALL_DEFINE6()
1554 retval = vm_mmap_pgoff(file, addr, len, prot, flags, pgoff); in SYSCALL_DEFINE6()
1556 if (file) in SYSCALL_DEFINE6()
1557 fput(file); in SYSCALL_DEFINE6()
1627 static inline int accountable_mapping(struct file *file, vm_flags_t vm_flags) in accountable_mapping() argument
1633 if (file && is_file_hugepages(file)) in accountable_mapping()
1639 unsigned long mmap_region(struct file *file, unsigned long addr, in mmap_region() argument
1674 if (accountable_mapping(file, vm_flags)) { in mmap_region()
1685 NULL, file, pgoff, NULL, NULL_VM_UFFD_CTX, NULL); in mmap_region()
1708 if (file) { in mmap_region()
1710 error = deny_write_access(file); in mmap_region()
1715 error = mapping_map_writable(file->f_mapping); in mmap_region()
1725 vma->vm_file = get_file(file); in mmap_region()
1726 error = call_mmap(file, vma); in mmap_region()
1749 if (file) { in mmap_region()
1751 mapping_unmap_writable(file->f_mapping); in mmap_region()
1753 allow_write_access(file); in mmap_region()
1755 file = vma->vm_file; in mmap_region()
1768 if (file) in mmap_region()
1786 fput(file); in mmap_region()
1792 mapping_unmap_writable(file->f_mapping); in mmap_region()
1795 allow_write_access(file); in mmap_region()
2019 arch_get_unmapped_area(struct file *filp, unsigned long addr, in arch_get_unmapped_area()
2056 arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, in arch_get_unmapped_area_topdown()
2108 get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, in get_unmapped_area() argument
2111 unsigned long (*get_area)(struct file *, unsigned long, in get_unmapped_area()
2123 if (file) { in get_unmapped_area()
2124 if (file->f_op->get_unmapped_area) in get_unmapped_area()
2125 get_area = file->f_op->get_unmapped_area; in get_unmapped_area()
2136 addr = get_area(file, addr, len, pgoff, flags); in get_unmapped_area()
2795 struct file *file; in SYSCALL_DEFINE5() local
2870 file = get_file(vma->vm_file); in SYSCALL_DEFINE5()
2873 fput(file); in SYSCALL_DEFINE5()