Source-Changes-HG archive

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

[src/trunk]: src/sys/dev flush cache on suspend



details:   https://anonhg.NetBSD.org/src/rev/68a5eb22bfb0
branches:  trunk
changeset: 757212:68a5eb22bfb0
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Aug 19 17:59:10 2010 +0000

description:
flush cache on suspend

diffstat:

 sys/dev/ld.c |  14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diffs (49 lines):

diff -r 067929caf8b4 -r 68a5eb22bfb0 sys/dev/ld.c
--- a/sys/dev/ld.c      Thu Aug 19 15:17:53 2010 +0000
+++ b/sys/dev/ld.c      Thu Aug 19 17:59:10 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ld.c,v 1.66 2009/07/23 21:38:33 dyoung Exp $   */
+/*     $NetBSD: ld.c,v 1.67 2010/08/19 17:59:10 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.66 2009/07/23 21:38:33 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.67 2010/08/19 17:59:10 jmcneill Exp $");
 
 #include "rnd.h"
 
@@ -67,6 +67,7 @@
 static void    ldgetdefaultlabel(struct ld_softc *, struct disklabel *);
 static void    ldgetdisklabel(struct ld_softc *);
 static void    ldminphys(struct buf *bp);
+static bool    ld_suspend(device_t, const pmf_qual_t *);
 static bool    ld_shutdown(device_t, int);
 static void    ldstart(struct ld_softc *, struct buf *);
 static void    ld_set_properties(struct ld_softc *);
@@ -154,7 +155,7 @@
 #endif
 
        /* Register with PMF */
-       if (!pmf_device_register1(sc->sc_dv, NULL, NULL, ld_shutdown))
+       if (!pmf_device_register1(sc->sc_dv, ld_suspend, NULL, ld_shutdown))
                aprint_error_dev(sc->sc_dv,
                    "couldn't establish power handler\n");
 
@@ -265,6 +266,13 @@
 
 /* ARGSUSED */
 static bool
+ld_suspend(device_t dev, const pmf_qual_t *qual)
+{
+       return ld_shutdown(dev, 0);
+}
+
+/* ARGSUSED */
+static bool
 ld_shutdown(device_t dev, int flags)
 {
        struct ld_softc *sc = device_private(dev);



Home | Main Index | Thread Index | Old Index