Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66339fda authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull pstore updates from Tony Luck:
 "Half dozen small cleanups plus change to allow pstore backend drivers
  to be unloaded"

* tag 'please-pull-pstore' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux:
  pstore: fix code comment to match code
  efi-pstore: fix kernel-doc argument name
  pstore: Fix return type of pstore_is_mounted()
  pstore: add pstore unregister
  pstore: add a helper function pstore_register_kmsg
  pstore: add vmalloc error check
parents 0fcb9d21 306e5c2a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ static int efi_pstore_read_func(struct efivar_entry *entry, void *data)

/**
 * efi_pstore_scan_sysfs_enter
 * @entry: scanning entry
 * @pos: scanning entry
 * @next: next entry
 * @head: list head
 */
+1 −1
Original line number Diff line number Diff line
config PSTORE
	bool "Persistent store support"
	tristate "Persistent store support"
	default n
	select ZLIB_DEFLATE
	select ZLIB_INFLATE
+3 −3
Original line number Diff line number Diff line
@@ -2,12 +2,12 @@
# Makefile for the linux pstorefs routines.
#

obj-y += pstore.o
obj-$(CONFIG_PSTORE) += pstore.o

pstore-objs += inode.o platform.o
obj-$(CONFIG_PSTORE_FTRACE)	+= ftrace.o
pstore-$(CONFIG_PSTORE_FTRACE)	+= ftrace.o

obj-$(CONFIG_PSTORE_PMSG)	+= pmsg.o
pstore-$(CONFIG_PSTORE_PMSG)	+= pmsg.o

ramoops-objs += ram.o ram_core.o
obj-$(CONFIG_PSTORE_RAM)	+= ramoops.o
+19 −6
Original line number Diff line number Diff line
@@ -104,22 +104,23 @@ static const struct file_operations pstore_knob_fops = {
	.write	= pstore_ftrace_knob_write,
};

static struct dentry *pstore_ftrace_dir;

void pstore_register_ftrace(void)
{
	struct dentry *dir;
	struct dentry *file;

	if (!psinfo->write_buf)
		return;

	dir = debugfs_create_dir("pstore", NULL);
	if (!dir) {
	pstore_ftrace_dir = debugfs_create_dir("pstore", NULL);
	if (!pstore_ftrace_dir) {
		pr_err("%s: unable to create pstore directory\n", __func__);
		return;
	}

	file = debugfs_create_file("record_ftrace", 0600, dir, NULL,
				   &pstore_knob_fops);
	file = debugfs_create_file("record_ftrace", 0600, pstore_ftrace_dir,
				   NULL, &pstore_knob_fops);
	if (!file) {
		pr_err("%s: unable to create record_ftrace file\n", __func__);
		goto err_file;
@@ -127,5 +128,17 @@ void pstore_register_ftrace(void)

	return;
err_file:
	debugfs_remove(dir);
	debugfs_remove(pstore_ftrace_dir);
}

void pstore_unregister_ftrace(void)
{
	mutex_lock(&pstore_ftrace_lock);
	if (pstore_ftrace_enabled) {
		unregister_ftrace_function(&pstore_ftrace_ops);
		pstore_ftrace_enabled = 0;
	}
	mutex_unlock(&pstore_ftrace_lock);

	debugfs_remove_recursive(pstore_ftrace_dir);
}
+10 −1
Original line number Diff line number Diff line
@@ -178,6 +178,7 @@ static loff_t pstore_file_llseek(struct file *file, loff_t off, int whence)
}

static const struct file_operations pstore_file_operations = {
	.owner		= THIS_MODULE,
	.open		= pstore_file_open,
	.read		= pstore_file_read,
	.llseek		= pstore_file_llseek,
@@ -287,7 +288,7 @@ static const struct super_operations pstore_ops = {

static struct super_block *pstore_sb;

int pstore_is_mounted(void)
bool pstore_is_mounted(void)
{
	return pstore_sb != NULL;
}
@@ -456,6 +457,7 @@ static void pstore_kill_sb(struct super_block *sb)
}

static struct file_system_type pstore_fs_type = {
	.owner          = THIS_MODULE,
	.name		= "pstore",
	.mount		= pstore_mount,
	.kill_sb	= pstore_kill_sb,
@@ -479,5 +481,12 @@ static int __init init_pstore_fs(void)
}
module_init(init_pstore_fs)

static void __exit exit_pstore_fs(void)
{
	unregister_filesystem(&pstore_fs_type);
	sysfs_remove_mount_point(fs_kobj, "pstore");
}
module_exit(exit_pstore_fs)

MODULE_AUTHOR("Tony Luck <tony.luck@intel.com>");
MODULE_LICENSE("GPL");
Loading