aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-07-25 04:47:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 13:53:39 -0400
commit32ecb1f26dd50eeaac4e3f4dea4541c97848e459 (patch)
tree4c2f3b6af9ff6babf2f395432de8e870508f2ec3 /fs/exec.c
parent24d5288f06ed8b3a368eba967d587cdb012dfdf7 (diff)
coredump: turn mm->core_startup_done into the pointer to struct core_state
mm->core_startup_done points to "struct completion startup_done" allocated on the coredump_wait()'s stack. Introduce the new structure, core_state, which holds this "struct completion". This way we can add more info visible to the threads participating in coredump without enlarging mm_struct. No changes in affected .o files. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/exec.c')
-rw-r--r--fs/exec.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/exec.c b/fs/exec.c
index e347e6ed1617..71734568f018 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1597,13 +1597,13 @@ static int coredump_wait(int exit_code)
1597{ 1597{
1598 struct task_struct *tsk = current; 1598 struct task_struct *tsk = current;
1599 struct mm_struct *mm = tsk->mm; 1599 struct mm_struct *mm = tsk->mm;
1600 struct completion startup_done; 1600 struct core_state core_state;
1601 struct completion *vfork_done; 1601 struct completion *vfork_done;
1602 int core_waiters; 1602 int core_waiters;
1603 1603
1604 init_completion(&mm->core_done); 1604 init_completion(&mm->core_done);
1605 init_completion(&startup_done); 1605 init_completion(&core_state.startup);
1606 mm->core_startup_done = &startup_done; 1606 mm->core_state = &core_state;
1607 1607
1608 core_waiters = zap_threads(tsk, mm, exit_code); 1608 core_waiters = zap_threads(tsk, mm, exit_code);
1609 up_write(&mm->mmap_sem); 1609 up_write(&mm->mmap_sem);
@@ -1622,7 +1622,7 @@ static int coredump_wait(int exit_code)
1622 } 1622 }
1623 1623
1624 if (core_waiters) 1624 if (core_waiters)
1625 wait_for_completion(&startup_done); 1625 wait_for_completion(&core_state.startup);
1626fail: 1626fail:
1627 BUG_ON(mm->core_waiters); 1627 BUG_ON(mm->core_waiters);
1628 return core_waiters; 1628 return core_waiters;