#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/blkdev.h>
#include <linux/string.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/pstore_blk.h>
#include <linux/fs.h>
#include <linux/file.h>
#include <linux/init_syscalls.h>
#include <linux/mount.h>
static long kmsg_size = …;
module_param(kmsg_size, long, 0400);
MODULE_PARM_DESC(…) …;
static int max_reason = …;
module_param(max_reason, int, 0400);
MODULE_PARM_DESC(…) …;
#if IS_ENABLED(CONFIG_PSTORE_PMSG)
static long pmsg_size = …;
#else
static long pmsg_size = -1;
#endif
module_param(pmsg_size, long, 0400);
MODULE_PARM_DESC(…) …;
#if IS_ENABLED(CONFIG_PSTORE_CONSOLE)
static long console_size = …;
#else
static long console_size = -1;
#endif
module_param(console_size, long, 0400);
MODULE_PARM_DESC(…) …;
#if IS_ENABLED(CONFIG_PSTORE_FTRACE)
static long ftrace_size = …;
#else
static long ftrace_size = -1;
#endif
module_param(ftrace_size, long, 0400);
MODULE_PARM_DESC(…) …;
static bool best_effort;
module_param(best_effort, bool, 0400);
MODULE_PARM_DESC(…) …;
static char blkdev[80] = …;
module_param_string(…);
MODULE_PARM_DESC(…) …;
static DEFINE_MUTEX(pstore_blk_lock);
static struct file *psblk_file;
static struct pstore_device_info *pstore_device_info;
#define check_size(name, alignsize) …
#define verify_size(name, alignsize, enabled) …
static int __register_pstore_device(struct pstore_device_info *dev)
{ … }
int register_pstore_device(struct pstore_device_info *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
static void __unregister_pstore_device(struct pstore_device_info *dev)
{ … }
void unregister_pstore_device(struct pstore_device_info *dev)
{ … }
EXPORT_SYMBOL_GPL(…);
static ssize_t psblk_generic_blk_read(char *buf, size_t bytes, loff_t pos)
{ … }
static ssize_t psblk_generic_blk_write(const char *buf, size_t bytes,
loff_t pos)
{ … }
static int __register_pstore_blk(struct pstore_device_info *dev,
const char *devpath)
{ … }
int pstore_blk_get_config(struct pstore_blk_config *info)
{ … }
EXPORT_SYMBOL_GPL(…);
#ifndef MODULE
static const char devname[] = …;
static __init const char *early_boot_devpath(const char *initial_devname)
{ … }
#else
static inline const char *early_boot_devpath(const char *initial_devname)
{
return initial_devname;
}
#endif
static int __init __best_effort_init(void)
{ … }
static void __exit __best_effort_exit(void)
{ … }
static int __init pstore_blk_init(void)
{ … }
late_initcall(pstore_blk_init);
static void __exit pstore_blk_exit(void)
{ … }
module_exit(pstore_blk_exit);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;