summaryrefslogtreecommitdiffstats
path: root/fs/exec.c
diff options
context:
space:
mode:
authorHiroshi Shimamoto2009-09-24 00:57:41 +0200
committerLinus Torvalds2009-09-24 16:21:05 +0200
commit801460d0cf5c5288153b722565773059b0f44348 (patch)
treeff2542903572a546ac59e92f295e9a18e718afa0 /fs/exec.c
parentinclude/linux/unaligned/{l,b}e_byteshift.h: fix usage for compressed kernels (diff)
downloadkernel-qcow2-linux-801460d0cf5c5288153b722565773059b0f44348.tar.gz
kernel-qcow2-linux-801460d0cf5c5288153b722565773059b0f44348.tar.xz
kernel-qcow2-linux-801460d0cf5c5288153b722565773059b0f44348.zip
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:
void set_binfmt(struct linux_binfmt *new)
{
- if (current->binfmt)
- module_put(current->binfmt->module);
+ struct mm_struct *mm = current->mm;
+
+ if (mm->binfmt)
+ module_put(mm->binfmt->module);
- current->binfmt = new;
+ mm->binfmt = new;
if (new)
__module_get(new->module);
}
@@ -1770,7 +1772,7 @@ void do_coredump(long signr, int exit_code, struct pt_regs *regs)
audit_core_dumps(signr);
- binfmt = current->binfmt;
+ binfmt = mm->binfmt;
if (!binfmt || !binfmt->core_dump)
goto fail;