* [PATCH 3/6] kexec jump: remove duplication of kexec_restart_prepare()
@ 2008-08-07 9:05 Huang Ying
2008-08-07 9:22 ` Pavel Machek
2008-08-07 13:17 ` Vivek Goyal
0 siblings, 2 replies; 3+ messages in thread
From: Huang Ying @ 2008-08-07 9:05 UTC (permalink / raw)
To: Eric W. Biederman, Pavel Machek, nigel, Rafael J. Wysocki,
Andrew Morton, Vivek Goyal, mingo, Linus Torvalds
Cc: linux-kernel, Kexec Mailing List
Call kernel_restart_prepare() in kernel_kexec() instead of duplicating
the code.
Signed-off-by: Huang Ying <ying.huang@intel.com>
---
include/linux/reboot.h | 1 +
kernel/kexec.c | 6 +-----
kernel/sys.c | 2 +-
3 files changed, 3 insertions(+), 6 deletions(-)
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -59,6 +59,7 @@ extern void machine_crash_shutdown(struc
* Architecture independent implemenations of sys_reboot commands.
*/
+extern void kernel_restart_prepare(char *cmd);
extern void kernel_restart(char *cmd);
extern void kernel_halt(void);
extern void kernel_power_off(void);
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -274,7 +274,7 @@ void emergency_restart(void)
}
EXPORT_SYMBOL_GPL(emergency_restart);
-static void kernel_restart_prepare(char *cmd)
+void kernel_restart_prepare(char *cmd)
{
blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd);
system_state = SYSTEM_RESTART;
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1472,11 +1472,7 @@ int kernel_kexec(void)
} else
#endif
{
- blocking_notifier_call_chain(&reboot_notifier_list,
- SYS_RESTART, NULL);
- system_state = SYSTEM_RESTART;
- device_shutdown();
- sysdev_shutdown();
+ kernel_restart_prepare(NULL);
printk(KERN_EMERG "Starting new kernel\n");
machine_shutdown();
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 3/6] kexec jump: remove duplication of kexec_restart_prepare()
2008-08-07 9:05 [PATCH 3/6] kexec jump: remove duplication of kexec_restart_prepare() Huang Ying
@ 2008-08-07 9:22 ` Pavel Machek
2008-08-07 13:17 ` Vivek Goyal
1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2008-08-07 9:22 UTC (permalink / raw)
To: Huang Ying
Cc: Eric W. Biederman, nigel, Rafael J. Wysocki, Andrew Morton,
Vivek Goyal, mingo, Linus Torvalds, linux-kernel,
Kexec Mailing List
> Call kernel_restart_prepare() in kernel_kexec() instead of duplicating
> the code.
>
> Signed-off-by: Huang Ying <ying.huang@intel.com>
ACK.
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 3/6] kexec jump: remove duplication of kexec_restart_prepare()
2008-08-07 9:05 [PATCH 3/6] kexec jump: remove duplication of kexec_restart_prepare() Huang Ying
2008-08-07 9:22 ` Pavel Machek
@ 2008-08-07 13:17 ` Vivek Goyal
1 sibling, 0 replies; 3+ messages in thread
From: Vivek Goyal @ 2008-08-07 13:17 UTC (permalink / raw)
To: Huang Ying
Cc: Eric W. Biederman, Pavel Machek, nigel, Rafael J. Wysocki,
Andrew Morton, mingo, Linus Torvalds, linux-kernel,
Kexec Mailing List
On Thu, Aug 07, 2008 at 05:05:28PM +0800, Huang Ying wrote:
> Call kernel_restart_prepare() in kernel_kexec() instead of duplicating
> the code.
>
> Signed-off-by: Huang Ying <ying.huang@intel.com>
>
> ---
> include/linux/reboot.h | 1 +
> kernel/kexec.c | 6 +-----
> kernel/sys.c | 2 +-
> 3 files changed, 3 insertions(+), 6 deletions(-)
>
> --- a/include/linux/reboot.h
> +++ b/include/linux/reboot.h
> @@ -59,6 +59,7 @@ extern void machine_crash_shutdown(struc
> * Architecture independent implemenations of sys_reboot commands.
> */
>
> +extern void kernel_restart_prepare(char *cmd);
> extern void kernel_restart(char *cmd);
> extern void kernel_halt(void);
> extern void kernel_power_off(void);
> --- a/kernel/sys.c
> +++ b/kernel/sys.c
> @@ -274,7 +274,7 @@ void emergency_restart(void)
> }
> EXPORT_SYMBOL_GPL(emergency_restart);
>
> -static void kernel_restart_prepare(char *cmd)
> +void kernel_restart_prepare(char *cmd)
> {
> blocking_notifier_call_chain(&reboot_notifier_list, SYS_RESTART, cmd);
> system_state = SYSTEM_RESTART;
> --- a/kernel/kexec.c
> +++ b/kernel/kexec.c
> @@ -1472,11 +1472,7 @@ int kernel_kexec(void)
> } else
> #endif
> {
> - blocking_notifier_call_chain(&reboot_notifier_list,
> - SYS_RESTART, NULL);
> - system_state = SYSTEM_RESTART;
> - device_shutdown();
> - sysdev_shutdown();
> + kernel_restart_prepare(NULL);
> printk(KERN_EMERG "Starting new kernel\n");
> machine_shutdown();
> }
Looks good to me.
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Thanks
Vivek
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-08-07 13:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-07 9:05 [PATCH 3/6] kexec jump: remove duplication of kexec_restart_prepare() Huang Ying
2008-08-07 9:22 ` Pavel Machek
2008-08-07 13:17 ` Vivek Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox