Source-Changes-HG archive

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

[src/netbsd-1-4]: src/sys/ufs/lfs Pull up revision 1.33 (requested by perseant):



details:   https://anonhg.NetBSD.org/src/rev/31c4e71b5a5a
branches:  netbsd-1-4
changeset: 469894:31c4e71b5a5a
user:      he <he%NetBSD.org@localhost>
date:      Sat Dec 18 00:01:53 1999 +0000

description:
Pull up revision 1.33 (requested by perseant):
  Handle the case of a vnode flush while dirops are active correctly
  in lfs_segwrite.  Also, make sure a flush is called in SET_DIROP
  before sleeping on its results.  Addresses PR#8863.

diffstat:

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

diffs (27 lines):

diff -r d7a35206fb41 -r 31c4e71b5a5a sys/ufs/lfs/lfs_vnops.c
--- a/sys/ufs/lfs/lfs_vnops.c   Sat Dec 18 00:01:26 1999 +0000
+++ b/sys/ufs/lfs/lfs_vnops.c   Sat Dec 18 00:01:53 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_vnops.c,v 1.25.2.3 1999/12/17 23:55:28 he Exp $    */
+/*     $NetBSD: lfs_vnops.c,v 1.25.2.4 1999/12/18 00:01:53 he Exp $    */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -300,9 +300,16 @@
        while (fs->lfs_writer || lfs_dirvcount>LFS_MAXDIROP) {
                if(fs->lfs_writer)
                        tsleep(&fs->lfs_dirops, PRIBIO + 1, "lfs_dirop", 0);
+               if(lfs_dirvcount > LFS_MAXDIROP && fs->lfs_dirops==0) {
+                       ++fs->lfs_writer;
+                       lfs_flush(fs, 0);
+                       if(--fs->lfs_writer==0)
+                               wakeup(&fs->lfs_dirops);
+               }
+
                if(lfs_dirvcount > LFS_MAXDIROP) {              
 #ifdef DEBUG_LFS
-                       printf("(dirvcount=%d)\n",lfs_dirvcount); 
+                       printf("lfs_set_dirop: sleeping with dirops=%d, dirvcount=%d\n",fs->lfs_dirops,lfs_dirvcount); 
 #endif
                        if((error=tsleep(&lfs_dirvcount, PCATCH|PUSER, "lfs_maxdirop", 0))!=0)
                                return error;



Home | Main Index | Thread Index | Old Index