diff options
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 25 |
1 files changed, 4 insertions, 21 deletions
@@ -231,11 +231,8 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma) | |||
231 | might_sleep(); | 231 | might_sleep(); |
232 | if (vma->vm_ops && vma->vm_ops->close) | 232 | if (vma->vm_ops && vma->vm_ops->close) |
233 | vma->vm_ops->close(vma); | 233 | vma->vm_ops->close(vma); |
234 | if (vma->vm_file) { | 234 | if (vma->vm_file) |
235 | fput(vma->vm_file); | 235 | fput(vma->vm_file); |
236 | if (vma->vm_flags & VM_EXECUTABLE) | ||
237 | removed_exe_file_vma(vma->vm_mm); | ||
238 | } | ||
239 | mpol_put(vma_policy(vma)); | 236 | mpol_put(vma_policy(vma)); |
240 | kmem_cache_free(vm_area_cachep, vma); | 237 | kmem_cache_free(vm_area_cachep, vma); |
241 | return next; | 238 | return next; |
@@ -636,8 +633,6 @@ again: remove_next = 1 + (end > next->vm_end); | |||
636 | if (file) { | 633 | if (file) { |
637 | uprobe_munmap(next, next->vm_start, next->vm_end); | 634 | uprobe_munmap(next, next->vm_start, next->vm_end); |
638 | fput(file); | 635 | fput(file); |
639 | if (next->vm_flags & VM_EXECUTABLE) | ||
640 | removed_exe_file_vma(mm); | ||
641 | } | 636 | } |
642 | if (next->anon_vma) | 637 | if (next->anon_vma) |
643 | anon_vma_merge(vma, next); | 638 | anon_vma_merge(vma, next); |
@@ -1304,8 +1299,6 @@ munmap_back: | |||
1304 | error = file->f_op->mmap(file, vma); | 1299 | error = file->f_op->mmap(file, vma); |
1305 | if (error) | 1300 | if (error) |
1306 | goto unmap_and_free_vma; | 1301 | goto unmap_and_free_vma; |
1307 | if (vm_flags & VM_EXECUTABLE) | ||
1308 | added_exe_file_vma(mm); | ||
1309 | 1302 | ||
1310 | /* Can addr have changed?? | 1303 | /* Can addr have changed?? |
1311 | * | 1304 | * |
@@ -1987,11 +1980,8 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, | |||
1987 | if (anon_vma_clone(new, vma)) | 1980 | if (anon_vma_clone(new, vma)) |
1988 | goto out_free_mpol; | 1981 | goto out_free_mpol; |
1989 | 1982 | ||
1990 | if (new->vm_file) { | 1983 | if (new->vm_file) |
1991 | get_file(new->vm_file); | 1984 | get_file(new->vm_file); |
1992 | if (vma->vm_flags & VM_EXECUTABLE) | ||
1993 | added_exe_file_vma(mm); | ||
1994 | } | ||
1995 | 1985 | ||
1996 | if (new->vm_ops && new->vm_ops->open) | 1986 | if (new->vm_ops && new->vm_ops->open) |
1997 | new->vm_ops->open(new); | 1987 | new->vm_ops->open(new); |
@@ -2009,11 +1999,8 @@ static int __split_vma(struct mm_struct * mm, struct vm_area_struct * vma, | |||
2009 | /* Clean everything up if vma_adjust failed. */ | 1999 | /* Clean everything up if vma_adjust failed. */ |
2010 | if (new->vm_ops && new->vm_ops->close) | 2000 | if (new->vm_ops && new->vm_ops->close) |
2011 | new->vm_ops->close(new); | 2001 | new->vm_ops->close(new); |
2012 | if (new->vm_file) { | 2002 | if (new->vm_file) |
2013 | if (vma->vm_flags & VM_EXECUTABLE) | ||
2014 | removed_exe_file_vma(mm); | ||
2015 | fput(new->vm_file); | 2003 | fput(new->vm_file); |
2016 | } | ||
2017 | unlink_anon_vmas(new); | 2004 | unlink_anon_vmas(new); |
2018 | out_free_mpol: | 2005 | out_free_mpol: |
2019 | mpol_put(pol); | 2006 | mpol_put(pol); |
@@ -2408,12 +2395,8 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap, | |||
2408 | new_vma->vm_start = addr; | 2395 | new_vma->vm_start = addr; |
2409 | new_vma->vm_end = addr + len; | 2396 | new_vma->vm_end = addr + len; |
2410 | new_vma->vm_pgoff = pgoff; | 2397 | new_vma->vm_pgoff = pgoff; |
2411 | if (new_vma->vm_file) { | 2398 | if (new_vma->vm_file) |
2412 | get_file(new_vma->vm_file); | 2399 | get_file(new_vma->vm_file); |
2413 | |||
2414 | if (vma->vm_flags & VM_EXECUTABLE) | ||
2415 | added_exe_file_vma(mm); | ||
2416 | } | ||
2417 | if (new_vma->vm_ops && new_vma->vm_ops->open) | 2400 | if (new_vma->vm_ops && new_vma->vm_ops->open) |
2418 | new_vma->vm_ops->open(new_vma); | 2401 | new_vma->vm_ops->open(new_vma); |
2419 | vma_link(mm, new_vma, prev, rb_link, rb_parent); | 2402 | vma_link(mm, new_vma, prev, rb_link, rb_parent); |