Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/ffs undo the part of the previous revision about ski...



details:   https://anonhg.NetBSD.org/src/rev/0ec26eb3a3d7
branches:  trunk
changeset: 515464:0ec26eb3a3d7
user:      chs <chs%NetBSD.org@localhost>
date:      Wed Sep 26 06:20:50 2001 +0000

description:
undo the part of the previous revision about skipping
the put if there are no pages, that seems to cause some problem.
fix another problem with missing an splx(), spotted by enami.

diffstat:

 sys/ufs/ffs/ffs_vnops.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r 465085090677 -r 0ec26eb3a3d7 sys/ufs/ffs/ffs_vnops.c
--- a/sys/ufs/ffs/ffs_vnops.c   Wed Sep 26 05:25:03 2001 +0000
+++ b/sys/ufs/ffs/ffs_vnops.c   Wed Sep 26 06:20:50 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_vnops.c,v 1.41 2001/09/26 05:25:03 chs Exp $       */
+/*     $NetBSD: ffs_vnops.c,v 1.42 2001/09/26 06:20:50 chs Exp $       */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -269,7 +269,7 @@
         * First, flush all pages in range.
         */
 
-       if (vp->v_uobj.uo_npages != 0) {
+       if (vp->v_type == VREG) {
                simple_lock(&vp->v_uobj.vmobjlock);
                error = (vp->v_uobj.pgops->pgo_put)(&vp->v_uobj,
                    trunc_page(ap->a_offlo), round_page(ap->a_offhi),
@@ -286,8 +286,10 @@
        s = splbio();
        if (!(ap->a_flags & FSYNC_DATAONLY) && blk_high >= NDADDR) {
                error = ufs_getlbns(vp, blk_high, ia, &num);
-               if (error)
+               if (error) {
+                       splx(s);
                        return error;
+               }
                for (i = 0; i < num; i++) {
                        bp = incore(vp, ia[i].in_lbn);
                        if (bp != NULL && !(bp->b_flags & B_BUSY) &&
@@ -342,7 +344,7 @@
         * Flush all dirty data associated with a vnode.
         */
 
-       if (vp->v_uobj.uo_npages != 0) {
+       if (vp->v_type == VREG) {
                uobj = &vp->v_uobj;
                simple_lock(&uobj->vmobjlock);
                error = (uobj->pgops->pgo_put)(uobj, 0, 0,



Home | Main Index | Thread Index | Old Index