forked from Freescale/linux-fslc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pstore: Centralize init/exit routines
In preparation for having additional actions during init/exit, this moves the init/exit into platform.c, centralizing the logic to make call outs to the fs init/exit. Signed-off-by: Kees Cook <[email protected]> Tested-by: Guenter Roeck <[email protected]>
- Loading branch information
Showing
3 changed files
with
28 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -482,12 +482,10 @@ static struct file_system_type pstore_fs_type = { | |
.kill_sb = pstore_kill_sb, | ||
}; | ||
|
||
static int __init init_pstore_fs(void) | ||
int __init pstore_init_fs(void) | ||
{ | ||
int err; | ||
|
||
pstore_choose_compression(); | ||
|
||
/* Create a convenient mount point for people to access pstore */ | ||
err = sysfs_create_mount_point(fs_kobj, "pstore"); | ||
if (err) | ||
|
@@ -500,14 +498,9 @@ static int __init init_pstore_fs(void) | |
out: | ||
return err; | ||
} | ||
module_init(init_pstore_fs) | ||
|
||
static void __exit exit_pstore_fs(void) | ||
void __exit pstore_exit_fs(void) | ||
{ | ||
unregister_filesystem(&pstore_fs_type); | ||
sysfs_remove_mount_point(fs_kobj, "pstore"); | ||
} | ||
module_exit(exit_pstore_fs) | ||
|
||
MODULE_AUTHOR("Tony Luck <[email protected]>"); | ||
MODULE_LICENSE("GPL"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -780,8 +780,31 @@ void __init pstore_choose_compression(void) | |
} | ||
} | ||
|
||
static int __init pstore_init(void) | ||
{ | ||
int ret; | ||
|
||
pstore_choose_compression(); | ||
|
||
ret = pstore_init_fs(); | ||
if (ret) | ||
return ret; | ||
|
||
return 0; | ||
} | ||
module_init(pstore_init) | ||
|
||
static void __exit pstore_exit(void) | ||
{ | ||
pstore_exit_fs(); | ||
} | ||
module_exit(pstore_exit) | ||
|
||
module_param(compress, charp, 0444); | ||
MODULE_PARM_DESC(compress, "Pstore compression to use"); | ||
|
||
module_param(backend, charp, 0444); | ||
MODULE_PARM_DESC(backend, "Pstore backend to use"); | ||
|
||
MODULE_AUTHOR("Tony Luck <[email protected]>"); | ||
MODULE_LICENSE("GPL"); |