Source-Changes-HG archive

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

[src/chs-ubc2]: src/sys/kern in vinvalbuf(), only write dirty page-cache page...



details:   https://anonhg.NetBSD.org/src/rev/b5e355660ccd
branches:  chs-ubc2
changeset: 471400:b5e355660ccd
user:      chs <chs%NetBSD.org@localhost>
date:      Sat Jul 31 18:37:55 1999 +0000

description:
in vinvalbuf(), only write dirty page-cache pages if V_SAVE is set.

diffstat:

 sys/kern/vfs_subr.c |  25 +++++++++++--------------
 1 files changed, 11 insertions(+), 14 deletions(-)

diffs (56 lines):

diff -r e1438fc5a69b -r b5e355660ccd sys/kern/vfs_subr.c
--- a/sys/kern/vfs_subr.c       Sat Jul 31 18:36:33 1999 +0000
+++ b/sys/kern/vfs_subr.c       Sat Jul 31 18:37:55 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_subr.c,v 1.100.4.2 1999/07/04 01:41:46 chs Exp $   */
+/*     $NetBSD: vfs_subr.c,v 1.100.4.3 1999/07/31 18:37:55 chs Exp $   */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -535,21 +535,18 @@
        struct proc *p;
        int slpflag, slptimeo;
 {
-       register struct buf *bp;
-       struct buf *nbp, *blist;
-       int s, error;
+       struct uvm_object *uobj = &vp->v_uvm.u_obj;
+       struct buf *bp, *nbp, *blist;
+       int s, error, rv;
+       int flushflags = PGO_ALLPAGES|PGO_FREE|PGO_SYNCIO|
+               (flags & V_SAVE ? PGO_CLEANIT : 0);
 
        /* XXX fixme! this doesn't look at flags or slp* */
        if (vp->v_type == VREG) {
-               struct uvm_object *uobj = &vp->v_uvm.u_obj;
-               int rv;
-
                simple_lock(&uobj->vmobjlock);
-               rv = (uobj->pgops->pgo_flush)(uobj, 0, 0,
-                       PGO_CLEANIT | PGO_ALLPAGES | PGO_FREE | PGO_SYNCIO);
+               rv = (uobj->pgops->pgo_flush)(uobj, 0, 0, flushflags);
                simple_unlock(&uobj->vmobjlock);
-
-               if (rv == 0) {
+               if (!rv) {
                        return EIO;
                }
        }
@@ -610,14 +607,14 @@
 
 void
 vflushbuf(vp, sync)
-       register struct vnode *vp;
+       struct vnode *vp;
        int sync;
 {
-       register struct buf *bp, *nbp;
+       struct uvm_object *uobj = &vp->v_uvm.u_obj;
+       struct buf *bp, *nbp;
        int s;
 
        if (vp->v_type == VREG) {
-               struct uvm_object *uobj = &vp->v_uvm.u_obj;
                int flags = PGO_CLEANIT|PGO_ALLPAGES| (sync ? PGO_SYNCIO : 0);
 
                simple_lock(&uobj->vmobjlock);



Home | Main Index | Thread Index | Old Index