Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/lfs Mark the current segment with SEGUSE_ACTIVE at m...



details:   https://anonhg.NetBSD.org/src/rev/046b4819130b
branches:  trunk
changeset: 471799:046b4819130b
user:      perseant <perseant%NetBSD.org@localhost>
date:      Sun Apr 11 23:31:09 1999 +0000

description:
Mark the current segment with SEGUSE_ACTIVE at mount time, rather than waiting
for the first write.  If this is not done, the cleaner may try to clean the
current segment out from under the writer if the filesystem is mounted after
a crash (or any other time that the dirty:clean segment ration is high enough).

diffstat:

 sys/ufs/lfs/lfs_vfsops.c |  11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diffs (32 lines):

diff -r c4af817b3ca2 -r 046b4819130b sys/ufs/lfs/lfs_vfsops.c
--- a/sys/ufs/lfs/lfs_vfsops.c  Sun Apr 11 23:24:04 1999 +0000
+++ b/sys/ufs/lfs/lfs_vfsops.c  Sun Apr 11 23:31:09 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_vfsops.c,v 1.29 1999/04/04 09:56:44 mycroft Exp $  */
+/*     $NetBSD: lfs_vfsops.c,v 1.30 1999/04/11 23:31:09 perseant Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -322,6 +322,7 @@
        dev_t dev;
        int error, i, ronly, size;
        struct ucred *cred;
+        SEGUSE *sup;
 
        cred = p ? p->p_ucred : NOCRED;
        /*
@@ -442,6 +443,14 @@
        VREF(vp);
        vput(vp);
 
+       /*
+        * Mark the current segment as ACTIVE, since we're going to 
+        * be writing to it.
+        */
+        LFS_SEGENTRY(sup, fs, datosn(fs, fs->lfs_offset), bp); 
+        sup->su_flags |= SEGUSE_DIRTY | SEGUSE_ACTIVE;
+        (void) VOP_BWRITE(bp); 
+
        return (0);
 out:
        if (bp)



Home | Main Index | Thread Index | Old Index