Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/usermode/dev sync disks and unmount at shutdown, an...



details:   https://anonhg.NetBSD.org/src/rev/9ab8faf3ae1d
branches:  trunk
changeset: 772765:9ab8faf3ae1d
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Jan 15 10:45:03 2012 +0000

description:
sync disks and unmount at shutdown, and run shutdownhooks + pmf shutdown
handlers

diffstat:

 sys/arch/usermode/dev/cpu.c |  18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diffs (50 lines):

diff -r c7d9d96e146c -r 9ab8faf3ae1d sys/arch/usermode/dev/cpu.c
--- a/sys/arch/usermode/dev/cpu.c       Sun Jan 15 10:35:08 2012 +0000
+++ b/sys/arch/usermode/dev/cpu.c       Sun Jan 15 10:45:03 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.66 2012/01/15 10:18:58 jmcneill Exp $ */
+/* $NetBSD: cpu.c,v 1.67 2012/01/15 10:45:03 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
 #include "opt_hz.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.66 2012/01/15 10:18:58 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.67 2012/01/15 10:45:03 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/conf.h>
@@ -44,6 +44,7 @@
 #include <sys/msgbuf.h>
 #include <sys/kmem.h>
 #include <sys/kernel.h>
+#include <sys/mount.h>
 
 #include <dev/cons.h>
 
@@ -127,11 +128,22 @@
 {
        extern void usermode_reboot(void);
 
-       splhigh();
+       if (cold)
+               howto |= RB_HALT;
+
+       if ((howto & RB_NOSYNC) == 0)
+               vfs_shutdown();
+       else
+               suspendsched();
+
+       doshutdownhooks();
+       pmf_system_shutdown(boothowto);
 
        if ((howto & RB_POWERDOWN) == RB_POWERDOWN)
                thunk_exit(0);
 
+       splhigh();
+
        if (howto & RB_DUMP)
                thunk_abort();
 



Home | Main Index | Thread Index | Old Index