#define pr_fmt(fmt) …
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/mount.h>
#include <linux/printk.h>
#include <linux/fs.h>
#include <linux/pstore_zone.h>
#include <linux/kdev_t.h>
#include <linux/device.h>
#include <linux/namei.h>
#include <linux/fcntl.h>
#include <linux/uio.h>
#include <linux/writeback.h>
#include "internal.h"
struct psz_buffer { … };
struct psz_kmsg_header { … };
struct pstore_zone { … };
struct psz_context { … };
static struct psz_context pstore_zone_cxt;
static void psz_flush_all_dirty_zones(struct work_struct *);
static DECLARE_DELAYED_WORK(psz_cleaner, psz_flush_all_dirty_zones);
enum psz_flush_mode { … };
static inline int buffer_datalen(struct pstore_zone *zone)
{ … }
static inline int buffer_start(struct pstore_zone *zone)
{ … }
static inline bool is_on_panic(void)
{ … }
static ssize_t psz_zone_read_buffer(struct pstore_zone *zone, char *buf,
size_t len, unsigned long off)
{ … }
static int psz_zone_read_oldbuf(struct pstore_zone *zone, char *buf,
size_t len, unsigned long off)
{ … }
static int psz_zone_write(struct pstore_zone *zone,
enum psz_flush_mode flush_mode, const char *buf,
size_t len, unsigned long off)
{ … }
static int psz_flush_dirty_zone(struct pstore_zone *zone)
{ … }
static int psz_flush_dirty_zones(struct pstore_zone **zones, unsigned int cnt)
{ … }
static int psz_move_zone(struct pstore_zone *old, struct pstore_zone *new)
{ … }
static void psz_flush_all_dirty_zones(struct work_struct *work)
{ … }
static int psz_kmsg_recover_data(struct psz_context *cxt)
{ … }
static int psz_kmsg_recover_meta(struct psz_context *cxt)
{ … }
static int psz_kmsg_recover(struct psz_context *cxt)
{ … }
static int psz_recover_zone(struct psz_context *cxt, struct pstore_zone *zone)
{ … }
static int psz_recover_zones(struct psz_context *cxt,
struct pstore_zone **zones, unsigned int cnt)
{ … }
static inline int psz_recovery(struct psz_context *cxt)
{ … }
static int psz_pstore_open(struct pstore_info *psi)
{ … }
static inline bool psz_old_ok(struct pstore_zone *zone)
{ … }
static inline bool psz_ok(struct pstore_zone *zone)
{ … }
static inline int psz_kmsg_erase(struct psz_context *cxt,
struct pstore_zone *zone, struct pstore_record *record)
{ … }
static inline int psz_record_erase(struct psz_context *cxt,
struct pstore_zone *zone)
{ … }
static int psz_pstore_erase(struct pstore_record *record)
{ … }
static void psz_write_kmsg_hdr(struct pstore_zone *zone,
struct pstore_record *record)
{ … }
static inline int notrace psz_kmsg_write_record(struct psz_context *cxt,
struct pstore_record *record)
{ … }
static int notrace psz_kmsg_write(struct psz_context *cxt,
struct pstore_record *record)
{ … }
static int notrace psz_record_write(struct pstore_zone *zone,
struct pstore_record *record)
{ … }
static int notrace psz_pstore_write(struct pstore_record *record)
{ … }
static struct pstore_zone *psz_read_next_zone(struct psz_context *cxt)
{ … }
static int psz_kmsg_read_hdr(struct pstore_zone *zone,
struct pstore_record *record)
{ … }
static ssize_t psz_kmsg_read(struct pstore_zone *zone,
struct pstore_record *record)
{ … }
static ssize_t psz_ftrace_read(struct pstore_zone *zone,
struct pstore_record *record)
{ … }
static ssize_t psz_record_read(struct pstore_zone *zone,
struct pstore_record *record)
{ … }
static ssize_t psz_pstore_read(struct pstore_record *record)
{ … }
static struct psz_context pstore_zone_cxt = …;
static void psz_free_zone(struct pstore_zone **pszone)
{ … }
static void psz_free_zones(struct pstore_zone ***pszones, unsigned int *cnt)
{ … }
static void psz_free_all_zones(struct psz_context *cxt)
{ … }
static struct pstore_zone *psz_init_zone(enum pstore_type_id type,
loff_t *off, size_t size)
{ … }
static struct pstore_zone **psz_init_zones(enum pstore_type_id type,
loff_t *off, size_t total_size, ssize_t record_size,
unsigned int *cnt)
{ … }
static int psz_alloc_zones(struct psz_context *cxt)
{ … }
int register_pstore_zone(struct pstore_zone_info *info)
{ … }
EXPORT_SYMBOL_GPL(…);
void unregister_pstore_zone(struct pstore_zone_info *info)
{ … }
EXPORT_SYMBOL_GPL(…);
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;