aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/fork.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-12 06:00:02 -0500
committerIngo Molnar <mingo@elte.hu>2008-12-12 06:00:14 -0500
commit92bf73e90a35d40ebc1446488218f03833b36f86 (patch)
tree8aaae58fcb7f3e06e63a5214f910acf47f4cc9d6 /kernel/fork.c
parent447557ac7ce120306b4a31d6003faef39cb1bf14 (diff)
parent915b0d0104b72fd36af088ba4b11b5690bc96a6c (diff)
Merge branch 'x86/irq' into perfcounters/core
( with manual semantic merge of arch/x86/kernel/cpu/perf_counter.c )
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 441fadff1fa4..e2078608ef59 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -315,17 +315,20 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
315 file = tmp->vm_file; 315 file = tmp->vm_file;
316 if (file) { 316 if (file) {
317 struct inode *inode = file->f_path.dentry->d_inode; 317 struct inode *inode = file->f_path.dentry->d_inode;
318 struct address_space *mapping = file->f_mapping;
319
318 get_file(file); 320 get_file(file);
319 if (tmp->vm_flags & VM_DENYWRITE) 321 if (tmp->vm_flags & VM_DENYWRITE)
320 atomic_dec(&inode->i_writecount); 322 atomic_dec(&inode->i_writecount);
321 323 spin_lock(&mapping->i_mmap_lock);
322 /* insert tmp into the share list, just after mpnt */ 324 if (tmp->vm_flags & VM_SHARED)
323 spin_lock(&file->f_mapping->i_mmap_lock); 325 mapping->i_mmap_writable++;
324 tmp->vm_truncate_count = mpnt->vm_truncate_count; 326 tmp->vm_truncate_count = mpnt->vm_truncate_count;
325 flush_dcache_mmap_lock(file->f_mapping); 327 flush_dcache_mmap_lock(mapping);
328 /* insert tmp into the share list, just after mpnt */
326 vma_prio_tree_add(tmp, mpnt); 329 vma_prio_tree_add(tmp, mpnt);
327 flush_dcache_mmap_unlock(file->f_mapping); 330 flush_dcache_mmap_unlock(mapping);
328 spin_unlock(&file->f_mapping->i_mmap_lock); 331 spin_unlock(&mapping->i_mmap_lock);
329 } 332 }
330 333
331 /* 334 /*
@@ -1399,6 +1402,7 @@ long do_fork(unsigned long clone_flags,
1399 init_completion(&vfork); 1402 init_completion(&vfork);
1400 } 1403 }
1401 1404
1405 audit_finish_fork(p);
1402 tracehook_report_clone(trace, regs, clone_flags, nr, p); 1406 tracehook_report_clone(trace, regs, clone_flags, nr, p);
1403 1407
1404 /* 1408 /*