Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/lfs Correct arguments to check_dirty, ensuring that ...



details:   https://anonhg.NetBSD.org/src/rev/641624505617
branches:  trunk
changeset: 546579:641624505617
user:      perseant <perseant%NetBSD.org@localhost>
date:      Fri May 02 01:47:39 2003 +0000

description:
Correct arguments to check_dirty, ensuring that all pages in a block are
written if any of them are dirty.  Pointed out by yamt.

diffstat:

 sys/ufs/lfs/lfs_vnops.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (46 lines):

diff -r 3a2f6cf5ad8e -r 641624505617 sys/ufs/lfs/lfs_vnops.c
--- a/sys/ufs/lfs/lfs_vnops.c   Fri May 02 00:42:40 2003 +0000
+++ b/sys/ufs/lfs/lfs_vnops.c   Fri May 02 01:47:39 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_vnops.c,v 1.104 2003/04/27 06:47:45 yamt Exp $     */
+/*     $NetBSD: lfs_vnops.c,v 1.105 2003/05/02 01:47:39 perseant Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.104 2003/04/27 06:47:45 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.105 2003/05/02 01:47:39 perseant Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1347,6 +1347,9 @@
  * either all are dirty or all are clean.  If any of the pages
  * we've seen so far are dirty, put the vnode on the paging chain,
  * and mark it IN_PAGING.
+ *
+ * If checkfirst != 0, don't check all the pages but return at the
+ * first dirty page.
  */
 static int
 check_dirty(struct lfs *fs, struct vnode *vp,
@@ -1737,7 +1740,7 @@
                 */
            again:
                check_dirty(fs, vp, startoffset, endoffset, blkeof,
-                           ap->a_flags, 1);
+                           ap->a_flags, 0);
 
                if ((error = genfs_putpages(v)) == EDEADLK) {
 #ifdef DEBUG_LFS
@@ -1818,7 +1821,7 @@
         */
     again2:
        simple_lock(&vp->v_interlock);
-       check_dirty(fs, vp, startoffset, endoffset, blkeof, ap->a_flags, 1);
+       check_dirty(fs, vp, startoffset, endoffset, blkeof, ap->a_flags, 0);
 
        if ((error = genfs_putpages(v)) == EDEADLK) {
 #ifdef DEBUG_LFS



Home | Main Index | Thread Index | Old Index