From 9abdcccc3d5f3c72f25cd48160f60d911353bee9 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Fri, 3 Mar 2017 16:59:29 -0800 Subject: pstore: Extract common arguments into structure The read/mkfile pair pass the same arguments and should be cleared between calls. Move to a structure and wipe it after every loop. Signed-off-by: Kees Cook --- include/linux/pstore.h | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'include/linux/pstore.h') diff --git a/include/linux/pstore.h b/include/linux/pstore.h index 56477ce6806a..745468072d6e 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h @@ -30,6 +30,8 @@ #include #include +struct module; + /* pstore record types (see fs/pstore/inode.c for filename templates) */ enum pstore_type_id { PSTORE_TYPE_DMESG = 0, @@ -45,7 +47,31 @@ enum pstore_type_id { PSTORE_TYPE_UNKNOWN = 255 }; -struct module; +struct pstore_info; +/** + * struct pstore_record - details of a pstore record entry + * @psi: pstore backend driver information + * @type: pstore record type + * @id: per-type unique identifier for record + * @time: timestamp of the record + * @count: for PSTORE_TYPE_DMESG, the Oops count. + * @compressed: for PSTORE_TYPE_DMESG, whether the buffer is compressed + * @buf: pointer to record contents + * @size: size of @buf + * @ecc_notice_size: + * ECC information for @buf + */ +struct pstore_record { + struct pstore_info *psi; + enum pstore_type_id type; + u64 id; + struct timespec time; + int count; + bool compressed; + char *buf; + ssize_t size; + ssize_t ecc_notice_size; +}; /** * struct pstore_info - backend pstore driver structure -- cgit