Source-Changes-HG archive

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

[src/trunk]: src/sys/uvm in uvn_flush(), interpret a "stop" value of 0 as mea...



details:   https://anonhg.NetBSD.org/src/rev/e6f5c76c196a
branches:  trunk
changeset: 503443:e6f5c76c196a
user:      chs <chs%NetBSD.org@localhost>
date:      Tue Feb 06 10:53:23 2001 +0000

description:
in uvn_flush(), interpret a "stop" value of 0 as meaning all pages at
offsets equal to or higher than "start".  use this in uvm_vnp_setsize()
instead of the vnode's size since there can be pages past EOF.

diffstat:

 sys/uvm/uvm_vnode.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r cd4cb1a088e5 -r e6f5c76c196a sys/uvm/uvm_vnode.c
--- a/sys/uvm/uvm_vnode.c       Tue Feb 06 10:32:34 2001 +0000
+++ b/sys/uvm/uvm_vnode.c       Tue Feb 06 10:53:23 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uvm_vnode.c,v 1.42 2001/01/28 23:30:47 thorpej Exp $   */
+/*     $NetBSD: uvm_vnode.c,v 1.43 2001/02/06 10:53:23 chs Exp $       */
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -342,6 +342,7 @@
 /*
  * uvn_flush: flush pages out of a uvm object.
  *
+ * => "stop == 0" means flush all pages at or after "start".
  * => object should be locked by caller.   we may _unlock_ the object
  *     if (and only if) we need to clean a page (PGO_CLEANIT), or
  *     if PGO_SYNCIO is set and there are pages busy.
@@ -425,6 +426,9 @@
         * get init vals and determine how we are going to traverse object
         */
 
+       if (stop == 0) {
+               stop = trunc_page(LLONG_MAX);
+       }
        curoff = 0;
        need_iosync = FALSE;
        retval = TRUE;
@@ -1034,7 +1038,7 @@
         */
 
        if (uvn->u_size > newsize && uvn->u_size != VSIZENOTSET) {
-               (void) uvn_flush(&uvn->u_obj, newsize, uvn->u_size, PGO_FREE);
+               (void) uvn_flush(&uvn->u_obj, newsize, 0, PGO_FREE);
        }
        uvn->u_size = newsize;
        simple_unlock(&uvn->u_obj.vmobjlock);



Home | Main Index | Thread Index | Old Index