summaryrefslogtreecommitdiff
path: root/include/linux/pstore.h
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2017-03-03 16:59:29 -0800
committerKees Cook <keescook@chromium.org>2017-03-07 14:00:53 -0800
commit9abdcccc3d5f3c72f25cd48160f60d911353bee9 (patch)
tree891a1584afc611a8312c1abbc39b4d2996033adf /include/linux/pstore.h
parent0edae0b3ffa6fc968d63932347a4d74b0ad0340b (diff)
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 <keescook@chromium.org>
Diffstat (limited to 'include/linux/pstore.h')
-rw-r--r--include/linux/pstore.h28
1 files changed, 27 insertions, 1 deletions
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 <linux/time.h>
#include <linux/types.h>
+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