diff options
Diffstat (limited to 'kernel/fork.c')
-rw-r--r-- | kernel/fork.c | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index a2b1efc20928..1cd7d581b3b2 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -423,7 +423,12 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm) | |||
423 | mapping->i_mmap_writable++; | 423 | mapping->i_mmap_writable++; |
424 | flush_dcache_mmap_lock(mapping); | 424 | flush_dcache_mmap_lock(mapping); |
425 | /* insert tmp into the share list, just after mpnt */ | 425 | /* insert tmp into the share list, just after mpnt */ |
426 | vma_prio_tree_add(tmp, mpnt); | 426 | if (unlikely(tmp->vm_flags & VM_NONLINEAR)) |
427 | vma_nonlinear_insert(tmp, | ||
428 | &mapping->i_mmap_nonlinear); | ||
429 | else | ||
430 | vma_interval_tree_insert_after(tmp, mpnt, | ||
431 | &mapping->i_mmap); | ||
427 | flush_dcache_mmap_unlock(mapping); | 432 | flush_dcache_mmap_unlock(mapping); |
428 | mutex_unlock(&mapping->i_mmap_mutex); | 433 | mutex_unlock(&mapping->i_mmap_mutex); |
429 | } | 434 | } |
@@ -622,26 +627,6 @@ void mmput(struct mm_struct *mm) | |||
622 | } | 627 | } |
623 | EXPORT_SYMBOL_GPL(mmput); | 628 | EXPORT_SYMBOL_GPL(mmput); |
624 | 629 | ||
625 | /* | ||
626 | * We added or removed a vma mapping the executable. The vmas are only mapped | ||
627 | * during exec and are not mapped with the mmap system call. | ||
628 | * Callers must hold down_write() on the mm's mmap_sem for these | ||
629 | */ | ||
630 | void added_exe_file_vma(struct mm_struct *mm) | ||
631 | { | ||
632 | mm->num_exe_file_vmas++; | ||
633 | } | ||
634 | |||
635 | void removed_exe_file_vma(struct mm_struct *mm) | ||
636 | { | ||
637 | mm->num_exe_file_vmas--; | ||
638 | if ((mm->num_exe_file_vmas == 0) && mm->exe_file) { | ||
639 | fput(mm->exe_file); | ||
640 | mm->exe_file = NULL; | ||
641 | } | ||
642 | |||
643 | } | ||
644 | |||
645 | void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file) | 630 | void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file) |
646 | { | 631 | { |
647 | if (new_exe_file) | 632 | if (new_exe_file) |
@@ -649,15 +634,13 @@ void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file) | |||
649 | if (mm->exe_file) | 634 | if (mm->exe_file) |
650 | fput(mm->exe_file); | 635 | fput(mm->exe_file); |
651 | mm->exe_file = new_exe_file; | 636 | mm->exe_file = new_exe_file; |
652 | mm->num_exe_file_vmas = 0; | ||
653 | } | 637 | } |
654 | 638 | ||
655 | struct file *get_mm_exe_file(struct mm_struct *mm) | 639 | struct file *get_mm_exe_file(struct mm_struct *mm) |
656 | { | 640 | { |
657 | struct file *exe_file; | 641 | struct file *exe_file; |
658 | 642 | ||
659 | /* We need mmap_sem to protect against races with removal of | 643 | /* We need mmap_sem to protect against races with removal of exe_file */ |
660 | * VM_EXECUTABLE vmas */ | ||
661 | down_read(&mm->mmap_sem); | 644 | down_read(&mm->mmap_sem); |
662 | exe_file = mm->exe_file; | 645 | exe_file = mm->exe_file; |
663 | if (exe_file) | 646 | if (exe_file) |
@@ -1078,7 +1061,6 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk) | |||
1078 | init_rwsem(&sig->group_rwsem); | 1061 | init_rwsem(&sig->group_rwsem); |
1079 | #endif | 1062 | #endif |
1080 | 1063 | ||
1081 | sig->oom_adj = current->signal->oom_adj; | ||
1082 | sig->oom_score_adj = current->signal->oom_score_adj; | 1064 | sig->oom_score_adj = current->signal->oom_score_adj; |
1083 | sig->oom_score_adj_min = current->signal->oom_score_adj_min; | 1065 | sig->oom_score_adj_min = current->signal->oom_score_adj_min; |
1084 | 1066 | ||