[IA64-SGI] move xpc_system_reboot()
Move xpc_system_reboot() to be closer to the file it calls for readability reasons (which are indeed subjective). Signed-off-by: Dean Nelson <dcn@sgi.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
This commit is contained in:
Родитель
1f4674b2d5
Коммит
d6ad033a88
|
@ -1047,7 +1047,35 @@ xpc_do_exit(enum xpc_retval reason)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called when the system is about to be either restarted or halted.
|
* This function is called when the system is being rebooted.
|
||||||
|
*/
|
||||||
|
static int
|
||||||
|
xpc_system_reboot(struct notifier_block *nb, unsigned long event, void *unused)
|
||||||
|
{
|
||||||
|
enum xpc_retval reason;
|
||||||
|
|
||||||
|
|
||||||
|
switch (event) {
|
||||||
|
case SYS_RESTART:
|
||||||
|
reason = xpcSystemReboot;
|
||||||
|
break;
|
||||||
|
case SYS_HALT:
|
||||||
|
reason = xpcSystemHalt;
|
||||||
|
break;
|
||||||
|
case SYS_POWER_OFF:
|
||||||
|
reason = xpcSystemPoweroff;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
reason = xpcSystemGoingDown;
|
||||||
|
}
|
||||||
|
|
||||||
|
xpc_do_exit(reason);
|
||||||
|
return NOTIFY_DONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Notify other partitions to disengage from all references to our memory.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
xpc_die_disengage(void)
|
xpc_die_disengage(void)
|
||||||
|
@ -1122,34 +1150,6 @@ xpc_die_disengage(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This function is called when the system is being rebooted.
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
xpc_system_reboot(struct notifier_block *nb, unsigned long event, void *unused)
|
|
||||||
{
|
|
||||||
enum xpc_retval reason;
|
|
||||||
|
|
||||||
|
|
||||||
switch (event) {
|
|
||||||
case SYS_RESTART:
|
|
||||||
reason = xpcSystemReboot;
|
|
||||||
break;
|
|
||||||
case SYS_HALT:
|
|
||||||
reason = xpcSystemHalt;
|
|
||||||
break;
|
|
||||||
case SYS_POWER_OFF:
|
|
||||||
reason = xpcSystemPoweroff;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
reason = xpcSystemGoingDown;
|
|
||||||
}
|
|
||||||
|
|
||||||
xpc_do_exit(reason);
|
|
||||||
return NOTIFY_DONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function is called when the system is being restarted or halted due
|
* This function is called when the system is being restarted or halted due
|
||||||
* to some sort of system failure. If this is the case we need to notify the
|
* to some sort of system failure. If this is the case we need to notify the
|
||||||
|
|
Загрузка…
Ссылка в новой задаче