aboutsummaryrefslogtreecommitdiffstats
path: root/fs/pstore/inode.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-10-20 00:39:03 -0700
committerTony Luck <tony.luck@intel.com>2015-10-22 08:59:18 -0700
commitee1d267423a1f8041e2b1a33fc23e4393c67677e (patch)
treeb53cdedcdc8f6a7b36f0342814b91005ce4955ea /fs/pstore/inode.c
parentpstore: add a helper function pstore_register_kmsg (diff)
downloadlinux-dev-ee1d267423a1f8041e2b1a33fc23e4393c67677e.tar.xz
linux-dev-ee1d267423a1f8041e2b1a33fc23e4393c67677e.zip
pstore: add pstore unregister
pstore doesn't support unregistering yet. It was marked as TODO. This patch adds some code to fix it: 1) Add functions to unregister kmsg/console/ftrace/pmsg. 2) Add a function to free compression buffer. 3) Unmap the memory and free it. 4) Add a function to unregister pstore filesystem. Signed-off-by: Geliang Tang <geliangtang@163.com> Acked-by: Kees Cook <keescook@chromium.org> [Removed __exit annotation from ramoops_remove(). Reported by Arnd Bergmann] Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'fs/pstore/inode.c')
-rw-r--r--fs/pstore/inode.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/pstore/inode.c b/fs/pstore/inode.c
index 3adcc4669fac..3586491f26ba 100644
--- a/fs/pstore/inode.c
+++ b/fs/pstore/inode.c
@@ -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,
@@ -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 @@ out:
}
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");