Source-Changes-HG archive

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

[src/trunk]: src/sys/dev Implement the DIOCCACHESYNC ioctl.



details:   https://anonhg.NetBSD.org/src/rev/8cbca13fb89e
branches:  trunk
changeset: 570749:8cbca13fb89e
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Oct 26 22:46:13 2004 +0000

description:
Implement the DIOCCACHESYNC ioctl.

diffstat:

 sys/dev/ld.c |  17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r fb14dc2d3134 -r 8cbca13fb89e sys/dev/ld.c
--- a/sys/dev/ld.c      Tue Oct 26 22:44:45 2004 +0000
+++ b/sys/dev/ld.c      Tue Oct 26 22:46:13 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ld.c,v 1.31 2004/10/17 17:02:48 jdolecek Exp $ */
+/*     $NetBSD: ld.c,v 1.32 2004/10/26 22:46:13 thorpej Exp $  */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.31 2004/10/17 17:02:48 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.32 2004/10/26 22:46:13 thorpej Exp $");
 
 #include "rnd.h"
 
@@ -483,6 +483,19 @@
                break;
 #endif
 
+       case DIOCCACHESYNC:
+               /*
+                * XXX Do we really need to care about having a writable
+                * file descriptor here?
+                */
+               if ((flag & FWRITE) == 0)
+                       error = EBADF;
+               else if (sc->sc_flush)
+                       error = (*sc->sc_flush)(sc);
+               else
+                       error = 0;      /* XXX Error out instead? */
+               break;
+
        case DIOCAWEDGE:
            {
                struct dkwedge_info *dkw = (void *) addr;



Home | Main Index | Thread Index | Old Index