freezer: remove PF_NOFREEZE from handle_initrd
Make handle_initrd() call try_to_freeze() in a suitable place instead of setting PF_NOFREEZE for the current task. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Nigel Cunningham <nigel@nigel.suspend2.net> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
0709db6072
commit
726162b5da
@ -55,11 +55,12 @@ static void __init handle_initrd(void)
|
|||||||
sys_mount(".", "/", NULL, MS_MOVE, NULL);
|
sys_mount(".", "/", NULL, MS_MOVE, NULL);
|
||||||
sys_chroot(".");
|
sys_chroot(".");
|
||||||
|
|
||||||
current->flags |= PF_NOFREEZE;
|
|
||||||
pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
|
pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);
|
||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
while (pid != sys_wait4(-1, NULL, 0, NULL))
|
while (pid != sys_wait4(-1, NULL, 0, NULL)) {
|
||||||
|
try_to_freeze();
|
||||||
yield();
|
yield();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* move initrd to rootfs' /old */
|
/* move initrd to rootfs' /old */
|
||||||
|
Loading…
Reference in New Issue
Block a user