Source-Changes-HG archive

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

[src/trunk]: src/sys/kern in vtruncbuf(), pass 0 (meaning everything at or pa...



details:   https://anonhg.NetBSD.org/src/rev/63345a474613
branches:  trunk
changeset: 503444:63345a474613
user:      chs <chs%NetBSD.org@localhost>
date:      Tue Feb 06 10:58:55 2001 +0000

description:
in vtruncbuf(), pass 0 (meaning everything at or past the start of the range)
instead of the vnode's size to pgo_flush() since there can be pages past EOF.
in the same call, cast "lbn" to voff_t to avoid overflow.

diffstat:

 sys/kern/vfs_subr.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (20 lines):

diff -r e6f5c76c196a -r 63345a474613 sys/kern/vfs_subr.c
--- a/sys/kern/vfs_subr.c       Tue Feb 06 10:53:23 2001 +0000
+++ b/sys/kern/vfs_subr.c       Tue Feb 06 10:58:55 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_subr.c,v 1.144 2001/01/08 07:05:47 chs Exp $       */
+/*     $NetBSD: vfs_subr.c,v 1.145 2001/02/06 10:58:55 chs Exp $       */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -747,8 +747,8 @@
        if (vp->v_type == VREG) {
                simple_lock(&uobj->vmobjlock);
                rv = (uobj->pgops->pgo_flush)(uobj,
-                   round_page(lbn << vp->v_mount->mnt_fs_bshift),
-                   vp->v_uvm.u_size, PGO_FREE|PGO_SYNCIO);
+                   round_page((voff_t)lbn << vp->v_mount->mnt_fs_bshift), 0,
+                   PGO_FREE|PGO_SYNCIO);
                simple_unlock(&uobj->vmobjlock);
                if (!rv) {
                        splx(s);



Home | Main Index | Thread Index | Old Index