coredump: Move definition of struct coredump_params into coredump.h
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 31 Jan 2022 17:50:46 +0000 (11:50 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Tue, 8 Mar 2022 18:50:58 +0000 (12:50 -0600)
Move the definition of struct coredump_params into coredump.h where
it belongs.

Remove the slightly errorneous comment explaining why struct
coredump_params was declared in binfmts.h.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/binfmt_flat.c
include/linux/binfmts.h
include/linux/coredump.h

index 5f0bf24bb3b856ce2b61fd88b7073fac22d1b49c..208cdce16de1b1643be373e87aa732fa776af1a2 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/flat.h>
 #include <linux/uaccess.h>
 #include <linux/vmalloc.h>
+#include <linux/coredump.h>
 
 #include <asm/byteorder.h>
 #include <asm/unaligned.h>
index 5d651c219c99b7ed4f6a6e5d757ae54b92ebc69b..3dc20c4f394cf9cc0041d0f8d56787662f81845a 100644 (file)
@@ -8,6 +8,7 @@
 #include <uapi/linux/binfmts.h>
 
 struct filename;
+struct coredump_params;
 
 #define CORENAME_MAX_SIZE 128
 
@@ -77,18 +78,6 @@ struct linux_binprm {
 #define BINPRM_FLAGS_PRESERVE_ARGV0_BIT 3
 #define BINPRM_FLAGS_PRESERVE_ARGV0 (1 << BINPRM_FLAGS_PRESERVE_ARGV0_BIT)
 
-/* Function parameter for binfmt->coredump */
-struct coredump_params {
-       const kernel_siginfo_t *siginfo;
-       struct pt_regs *regs;
-       struct file *file;
-       unsigned long limit;
-       unsigned long mm_flags;
-       loff_t written;
-       loff_t pos;
-       loff_t to_skip;
-};
-
 /*
  * This structure defines the functions that are used to load the binary formats that
  * linux accepts.
index 248a68c668b4590685ca02d699310ccb7d3373ce..2ee1460a1d66e5a38c49337fc3e2f34271f89e3a 100644 (file)
@@ -14,11 +14,21 @@ struct core_vma_metadata {
        unsigned long dump_size;
 };
 
+struct coredump_params {
+       const kernel_siginfo_t *siginfo;
+       struct pt_regs *regs;
+       struct file *file;
+       unsigned long limit;
+       unsigned long mm_flags;
+       loff_t written;
+       loff_t pos;
+       loff_t to_skip;
+};
+
 /*
  * These are the only things you should do on a core-file: use only these
  * functions to write out all the necessary info.
  */
-struct coredump_params;
 extern void dump_skip_to(struct coredump_params *cprm, unsigned long to);
 extern void dump_skip(struct coredump_params *cprm, size_t nr);
 extern int dump_emit(struct coredump_params *cprm, const void *addr, int nr);