diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-08-05 10:32:54 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-08-05 10:33:55 +0200 |
commit | 3272cab4063467410802367a8d69f06c65b2a866 (patch) | |
tree | 1c665f8572b0aab2a5343d32b5eaa6713669b04f /kernel/sys.c | |
parent | f629299b544b6cc12b4e3e85fec96f4ce5809482 (diff) | |
parent | 140d0b2108faebc77c6523296e211e509cb9f5f9 (diff) |
Merge branch 'linus' into perf/urgent
Merge reason: Include most of the merge window trees, to do fixes on top.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index e4128b278f2..a101ba36c44 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -8,7 +8,6 @@ #include <linux/mm.h> #include <linux/utsname.h> #include <linux/mman.h> -#include <linux/notifier.h> #include <linux/reboot.h> #include <linux/prctl.h> #include <linux/highuid.h> @@ -320,6 +319,37 @@ void kernel_restart_prepare(char *cmd) } /** + * register_reboot_notifier - Register function to be called at reboot time + * @nb: Info about notifier function to be called + * + * Registers a function with the list of functions + * to be called at reboot time. + * + * Currently always returns zero, as blocking_notifier_chain_register() + * always returns zero. + */ +int register_reboot_notifier(struct notifier_block *nb) +{ + return blocking_notifier_chain_register(&reboot_notifier_list, nb); +} +EXPORT_SYMBOL(register_reboot_notifier); + +/** + * unregister_reboot_notifier - Unregister previously registered reboot notifier + * @nb: Hook to be unregistered + * + * Unregisters a previously registered reboot + * notifier function. + * + * Returns zero on success, or %-ENOENT on failure. + */ +int unregister_reboot_notifier(struct notifier_block *nb) +{ + return blocking_notifier_chain_unregister(&reboot_notifier_list, nb); +} +EXPORT_SYMBOL(unregister_reboot_notifier); + +/** * kernel_restart - reboot the system * @cmd: pointer to buffer containing command to execute for restart * or %NULL |