coredump: update coredump-related headers
authorAlex Kelly <alex.page.kelly@gmail.com>
Fri, 5 Oct 2012 00:15:24 +0000 (17:15 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 5 Oct 2012 18:05:15 +0000 (03:05 +0900)
Create a new header file, fs/coredump.h, which contains functions only
used by the new coredump.c.  It also moves do_coredump to the
include/linux/coredump.h header file, for consistency.

Signed-off-by: Alex Kelly <alex.page.kelly@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/coredump.c
fs/coredump.h [new file with mode: 0644]
fs/exec.c
include/linux/binfmts.h
include/linux/coredump.h
include/linux/sched.h
kernel/signal.c

index f045bbad682294330023e9a09020f16ccb9c241c..c01aa7b9ab5ddb3ac78e98cbcfad31ccf1220b07 100644 (file)
@@ -14,6 +14,7 @@
 #include <linux/key.h>
 #include <linux/personality.h>
 #include <linux/binfmts.h>
+#include <linux/coredump.h>
 #include <linux/utsname.h>
 #include <linux/pid_namespace.h>
 #include <linux/module.h>
@@ -39,6 +40,7 @@
 
 #include <trace/events/task.h>
 #include "internal.h"
+#include "coredump.h"
 
 #include <trace/events/sched.h>
 
diff --git a/fs/coredump.h b/fs/coredump.h
new file mode 100644 (file)
index 0000000..e39ff07
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _FS_COREDUMP_H
+#define _FS_COREDUMP_H
+
+extern int __get_dumpable(unsigned long mm_flags);
+
+#endif
index 48fb26ef8a1b3daebb49a74c9ae09ba83c7f7a14..bd941a1cdbfc1f45860f93e1b8eca1083250f4c3 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -63,6 +63,7 @@
 
 #include <trace/events/task.h>
 #include "internal.h"
+#include "coredump.h"
 
 #include <trace/events/sched.h>
 
index 00e2e8908953d4eb314f4f91e720903ec309a45b..c7b16ee71415f274c0bdc2895687d94b2ec29e7c 100644 (file)
@@ -132,11 +132,6 @@ extern int copy_strings_kernel(int argc, const char *const *argv,
                               struct linux_binprm *bprm);
 extern int prepare_bprm_creds(struct linux_binprm *bprm);
 extern void install_exec_creds(struct linux_binprm *bprm);
-#ifdef CONFIG_COREDUMP
-extern void do_coredump(long signr, int exit_code, struct pt_regs *regs);
-#else
-static inline void do_coredump(long signr, int exit_code, struct pt_regs *regs) {}
-#endif
 extern void set_binfmt(struct linux_binfmt *new);
 extern void free_bprm(struct linux_binprm *);
 
index ba4b85a6d9b8bc71853de37df2a36b865707b745..42f9752a0a404f900569c1f25a6caef55661cf74 100644 (file)
  */
 extern int dump_write(struct file *file, const void *addr, int nr);
 extern int dump_seek(struct file *file, loff_t off);
+#ifdef CONFIG_COREDUMP
+extern void do_coredump(long signr, int exit_code, struct pt_regs *regs);
+#else
+static inline void do_coredump(long signr, int exit_code, struct pt_regs *regs) {}
+#endif
 
 #endif /* _LINUX_COREDUMP_H */
index 9d51e260bde03536c75b3fc66f034a38ea420993..9c5612f0374b3b419b70066dd61599b32d6b0b9d 100644 (file)
@@ -405,7 +405,6 @@ static inline void arch_pick_mmap_layout(struct mm_struct *mm) {}
 
 extern void set_dumpable(struct mm_struct *mm, int value);
 extern int get_dumpable(struct mm_struct *mm);
-extern int __get_dumpable(unsigned long mm_flags);
 
 /* get/set_dumpable() values */
 #define SUID_DUMPABLE_DISABLED 0
index 2c681f11b7d24b9deab0e7b4a7c1498f11a23b16..2ad3f5904bd7f0e11b2b4db927db687083ab86c2 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/fs.h>
 #include <linux/tty.h>
 #include <linux/binfmts.h>
+#include <linux/coredump.h>
 #include <linux/security.h>
 #include <linux/syscalls.h>
 #include <linux/ptrace.h>