aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorHiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>2009-09-23 18:57:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-24 10:21:05 -0400
commit801460d0cf5c5288153b722565773059b0f44348 (patch)
treeff2542903572a546ac59e92f295e9a18e718afa0 /fs/exec.c
parent2fa4341074cd02fb39aa23410740764948755635 (diff)
task_struct cleanup: move binfmt field to mm_struct
Because the binfmt is not different between threads in the same process, it can be moved from task_struct to mm_struct. And binfmt moudle is handled per mm_struct instead of task_struct. Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com> Acked-by: Oleg Nesterov <oleg@redhat.com> Cc: Rusty Russell <rusty@rustcorp.com.au> Acked-by: 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.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/exec.c b/fs/exec.c
index 6dc92c39dd94..d49be6bc1793 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1397,10 +1397,12 @@ out_ret:
1397 1397
1398void set_binfmt(struct linux_binfmt *new) 1398void set_binfmt(struct linux_binfmt *new)
1399{ 1399{
1400 if (current->binfmt) 1400 struct mm_struct *mm = current->mm;
1401 module_put(current->binfmt->module); 1401
1402 if (mm->binfmt)
1403 module_put(mm->binfmt->module);
1402 1404
1403 current->binfmt = new; 1405 mm->binfmt = new;
1404 if (new) 1406 if (new)
1405 __module_get(new->module); 1407 __module_get(new->module);
1406} 1408}
@@ -1770,7 +1772,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
1770 1772
1771 audit_core_dumps(signr); 1773 audit_core_dumps(signr);
1772 1774
1773 binfmt = current->binfmt; 1775 binfmt = mm->binfmt;
1774 if (!binfmt || !binfmt->core_dump) 1776 if (!binfmt || !binfmt->core_dump)
1775 goto fail; 1777 goto fail;
1776 1778