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 revisions 1.29-1.30 (requested by p...



details:   https://anonhg.NetBSD.org/src/rev/d65964150285
branches:  netbsd-1-4
changeset: 470099:d65964150285
user:      he <he%NetBSD.org@localhost>
date:      Thu Jan 20 21:02:03 2000 +0000

description:
Pull up revisions 1.29-1.30 (requested by perseant):
  Files removed (through unlink, rmdir) are now really removed, though the
  removal is postponed until the dirop is complete to ensure validity of
  the filesystem through a crash.  Use a separate per-fs lock, instead of
  ufs_hashlock, to protect the inode free list.  Change calling semantics
  of lfs_ifind, to give better error reporting:  If fed a struct buf, it
  can report the block number of the offending inode block as well as the
  inode number.

diffstat:

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

diffs (42 lines):

diff -r 0c1ad321d407 -r d65964150285 sys/ufs/lfs/lfs_inode.c
--- a/sys/ufs/lfs/lfs_inode.c   Thu Jan 20 21:01:33 2000 +0000
+++ b/sys/ufs/lfs/lfs_inode.c   Thu Jan 20 21:02:03 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_inode.c,v 1.22.2.4 2000/01/15 17:51:09 he Exp $    */
+/*     $NetBSD: lfs_inode.c,v 1.22.2.5 2000/01/20 21:02:03 he Exp $    */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -98,18 +98,21 @@
 
 /* Search a block for a specific dinode. */
 struct dinode *
-lfs_ifind(fs, ino, dip)
+lfs_ifind(fs, ino, bp)
        struct lfs *fs;
        ino_t ino;
-       register struct dinode *dip;
+       struct buf *bp;
 {
        register int cnt;
+       register struct dinode *dip = (struct dinode *)bp->b_data;
        register struct dinode *ldip;
        
        for (cnt = INOPB(fs), ldip = dip + (cnt - 1); cnt--; --ldip)
                if (ldip->di_inumber == ino)
                        return (ldip);
        
+       printf("offset is %d (seg %d)\n", fs->lfs_offset, datosn(fs,fs->lfs_offset));
+       printf("block is %d (seg %d)\n", bp->b_blkno, datosn(fs,bp->b_blkno));
        panic("lfs_ifind: dinode %u not found", ino);
        /* NOTREACHED */
 }
@@ -269,7 +272,7 @@
         *
         * XXX KS - too restrictive?  Maybe only when cleaning?
         */
-       while(fs->lfs_seglock) {
+       while(fs->lfs_seglock && fs->lfs_lockpid != ap->a_p->p_pid) {
                tsleep(&fs->lfs_seglock, (PRIBIO+1), "lfs_truncate", 0);
        }
        



Home | Main Index | Thread Index | Old Index