aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mmap.c')
-rw-r--r--mm/mmap.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index ffd6c6c9bcf4..22dff49d579e 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -657,9 +657,6 @@ again: remove_next = 1 + (end > next->vm_end);
657 validate_mm(mm); 657 validate_mm(mm);
658} 658}
659 659
660/* Flags that can be inherited from an existing mapping when merging */
661#define VM_MERGEABLE_FLAGS (VM_CAN_NONLINEAR)
662
663/* 660/*
664 * If the vma has a ->close operation then the driver probably needs to release 661 * If the vma has a ->close operation then the driver probably needs to release
665 * per-vma resources, so we don't attempt to merge those. 662 * per-vma resources, so we don't attempt to merge those.
@@ -667,7 +664,8 @@ again: remove_next = 1 + (end > next->vm_end);
667static inline int is_mergeable_vma(struct vm_area_struct *vma, 664static inline int is_mergeable_vma(struct vm_area_struct *vma,
668 struct file *file, unsigned long vm_flags) 665 struct file *file, unsigned long vm_flags)
669{ 666{
670 if ((vma->vm_flags ^ vm_flags) & ~VM_MERGEABLE_FLAGS) 667 /* VM_CAN_NONLINEAR may get set later by f_op->mmap() */
668 if ((vma->vm_flags ^ vm_flags) & ~VM_CAN_NONLINEAR)
671 return 0; 669 return 0;
672 if (vma->vm_file != file) 670 if (vma->vm_file != file)
673 return 0; 671 return 0;