#define pr_fmt(fmt) …
#include <linux/atomic.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/kmsg_dump.h>
#include <linux/console.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/pstore.h>
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/jiffies.h>
#include <linux/vmalloc.h>
#include <linux/workqueue.h>
#include <linux/zlib.h>
#include "internal.h"
static int pstore_update_ms = …;
module_param_named(update_ms, pstore_update_ms, int, 0600);
MODULE_PARM_DESC(…) …;
static const char * const pstore_type_names[] = …;
static int pstore_new_entry;
static void pstore_timefunc(struct timer_list *);
static DEFINE_TIMER(pstore_timer, pstore_timefunc);
static void pstore_dowork(struct work_struct *);
static DECLARE_WORK(pstore_work, pstore_dowork);
static DEFINE_MUTEX(psinfo_lock);
struct pstore_info *psinfo;
static char *backend;
module_param(backend, charp, 0444);
MODULE_PARM_DESC(…) …;
static char *compress = …;
module_param(compress, charp, 0444);
MODULE_PARM_DESC(…) …;
unsigned long kmsg_bytes = …;
module_param(kmsg_bytes, ulong, 0444);
MODULE_PARM_DESC(…) …;
static void *compress_workspace;
#define DMESG_COMP_PERCENT …
static char *big_oops_buf;
static size_t max_compressed_size;
void pstore_set_kmsg_bytes(int bytes)
{ … }
static int oopscount;
const char *pstore_type_to_name(enum pstore_type_id type)
{ … }
EXPORT_SYMBOL_GPL(…);
enum pstore_type_id pstore_name_to_type(const char *name)
{ … }
EXPORT_SYMBOL_GPL(…);
static void pstore_timer_kick(void)
{ … }
static bool pstore_cannot_block_path(enum kmsg_dump_reason reason)
{ … }
static int pstore_compress(const void *in, void *out,
unsigned int inlen, unsigned int outlen)
{ … }
static void allocate_buf_for_compression(void)
{ … }
static void free_buf_for_compression(void)
{ … }
void pstore_record_init(struct pstore_record *record,
struct pstore_info *psinfo)
{ … }
static void pstore_dump(struct kmsg_dumper *dumper,
enum kmsg_dump_reason reason)
{ … }
static struct kmsg_dumper pstore_dumper = …;
static void pstore_register_kmsg(void)
{ … }
static void pstore_unregister_kmsg(void)
{ … }
#ifdef CONFIG_PSTORE_CONSOLE
static void pstore_console_write(struct console *con, const char *s, unsigned c)
{ … }
static struct console pstore_console = …;
static void pstore_register_console(void)
{ … }
static void pstore_unregister_console(void)
{ … }
#else
static void pstore_register_console(void) {}
static void pstore_unregister_console(void) {}
#endif
static int pstore_write_user_compat(struct pstore_record *record,
const char __user *buf)
{ … }
int pstore_register(struct pstore_info *psi)
{ … }
EXPORT_SYMBOL_GPL(…);
void pstore_unregister(struct pstore_info *psi)
{ … }
EXPORT_SYMBOL_GPL(…);
static void decompress_record(struct pstore_record *record,
struct z_stream_s *zstream)
{ … }
void pstore_get_backend_records(struct pstore_info *psi,
struct dentry *root, int quiet)
{ … }
static void pstore_dowork(struct work_struct *work)
{ … }
static void pstore_timefunc(struct timer_list *unused)
{ … }
static int __init pstore_init(void)
{ … }
late_initcall(pstore_init);
static void __exit pstore_exit(void)
{ … }
module_exit(…)
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;