Module Name: src
Committed By: jmcneill
Date: Thu Aug 19 17:59:11 UTC 2010
Modified Files:
src/sys/dev: ld.c
Log Message:
flush cache on suspend
To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/dev/ld.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ld.c
diff -u src/sys/dev/ld.c:1.66 src/sys/dev/ld.c:1.67
--- src/sys/dev/ld.c:1.66 Thu Jul 23 21:38:33 2009
+++ src/sys/dev/ld.c Thu Aug 19 17:59:10 2010
@@ -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);