linux/fs/pstore/blk.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Implements pstore backend driver that write to block (or non-block) storage
 * devices, using the pstore/zone API.
 */

#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();

/*
 * blkdev - the block device to use for pstore storage
 * See Documentation/admin-guide/pstore-blk.rst for details.
 */
static char blkdev[80] =;
module_param_string();
MODULE_PARM_DESC();

/*
 * All globals must only be accessed under the pstore_blk_lock
 * during the register/unregister functions.
 */
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)
{}
/**
 * register_pstore_device() - register non-block device to pstore/blk
 *
 * @dev: non-block device information
 *
 * Return:
 * * 0		- OK
 * * Others	- something error.
 */
int register_pstore_device(struct pstore_device_info *dev)
{}
EXPORT_SYMBOL_GPL();

static void __unregister_pstore_device(struct pstore_device_info *dev)
{}

/**
 * unregister_pstore_device() - unregister non-block device from pstore/blk
 *
 * @dev: non-block device information
 */
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)
{}

/*
 * This takes its configuration only from the module parameters now.
 */
static int __register_pstore_blk(struct pstore_device_info *dev,
				 const char *devpath)
{}

/* get information of pstore/blk */
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();