diff options
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1306,7 +1306,9 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | |||
1306 | } | 1306 | } |
1307 | 1307 | ||
1308 | addr = mmap_region(file, addr, len, vm_flags, pgoff); | 1308 | addr = mmap_region(file, addr, len, vm_flags, pgoff); |
1309 | if (!IS_ERR_VALUE(addr) && (vm_flags & VM_POPULATE)) | 1309 | if (!IS_ERR_VALUE(addr) && |
1310 | ((vm_flags & VM_LOCKED) || | ||
1311 | (flags & (MAP_POPULATE | MAP_NONBLOCK)) == MAP_POPULATE)) | ||
1310 | *populate = len; | 1312 | *populate = len; |
1311 | return addr; | 1313 | return addr; |
1312 | } | 1314 | } |
@@ -1938,7 +1940,7 @@ struct vm_area_struct *find_vma(struct mm_struct *mm, unsigned long addr) | |||
1938 | 1940 | ||
1939 | /* Check the cache first. */ | 1941 | /* Check the cache first. */ |
1940 | /* (Cache hit rate is typically around 35%.) */ | 1942 | /* (Cache hit rate is typically around 35%.) */ |
1941 | vma = mm->mmap_cache; | 1943 | vma = ACCESS_ONCE(mm->mmap_cache); |
1942 | if (!(vma && vma->vm_end > addr && vma->vm_start <= addr)) { | 1944 | if (!(vma && vma->vm_end > addr && vma->vm_start <= addr)) { |
1943 | struct rb_node *rb_node; | 1945 | struct rb_node *rb_node; |
1944 | 1946 | ||