aboutsummaryrefslogtreecommitdiffstats
path: root/mm/nommu.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/nommu.c')
-rw-r--r--mm/nommu.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/nommu.c b/mm/nommu.c
index ba6df4d29979..cbbc13774819 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -826,6 +826,11 @@ unsigned long do_mmap_pgoff(struct file *file,
826 unsigned long pglen = (len + PAGE_SIZE - 1) >> PAGE_SHIFT; 826 unsigned long pglen = (len + PAGE_SIZE - 1) >> PAGE_SHIFT;
827 unsigned long vmpglen; 827 unsigned long vmpglen;
828 828
829 /* suppress VMA sharing for shared regions */
830 if (vm_flags & VM_SHARED &&
831 capabilities & BDI_CAP_MAP_DIRECT)
832 goto dont_share_VMAs;
833
829 for (rb = rb_first(&nommu_vma_tree); rb; rb = rb_next(rb)) { 834 for (rb = rb_first(&nommu_vma_tree); rb; rb = rb_next(rb)) {
830 vma = rb_entry(rb, struct vm_area_struct, vm_rb); 835 vma = rb_entry(rb, struct vm_area_struct, vm_rb);
831 836
@@ -859,6 +864,7 @@ unsigned long do_mmap_pgoff(struct file *file,
859 goto shared; 864 goto shared;
860 } 865 }
861 866
867 dont_share_VMAs:
862 vma = NULL; 868 vma = NULL;
863 869
864 /* obtain the address at which to make a shared mapping 870 /* obtain the address at which to make a shared mapping