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 of changes made to the trunk on Sun...
details: https://anonhg.NetBSD.org/src/rev/78d6d5796e8a
branches: netbsd-1-4
changeset: 468210:78d6d5796e8a
user: perseant <perseant%NetBSD.org@localhost>
date: Tue Apr 13 21:33:54 1999 +0000
description:
Pull-up of changes made to the trunk on Sunday [1.18->1.19], to wit:
Take out the `#ifdef USE_UFSHASH'; use ufs_hashlock to lock the inode free
list instead of free_lock.
Fix inode reporting in lfs_statfs (the meaning of f_files and f_ffree was
reversed).
Fix "lfs_ifind: dinode xxx not found" panic. When inodes were freed, then
immediately reloaded, their dinodes were located in an inode block which
was not on disk at the advertized location, nor in the cache (although it
would be flushed to disk next segment write). Fix this by using getblk()
instead of lfs_newbuf() for inode blocks.
Better checking for held inode locks in lfs_fastvget, for a number of
error conditions. Also change the default setting of lfs_clean_vnhead to
0, which seems to make the locking problems go away (although this is
difficult to test as I can't reliably reproduce them).
Make sure that the wakeup occurs for vnodes that lfs_update might be
sleeping on (nodes which are not marked IN_MODIFIED/IN_CLEANING, but which
have dirty buffers), by marking them with the appropriate flag if
dirtybuffers were added while the write was in progress.
Fix block counting during file truncation, if not truncating to zero.
Disallow threshold-initiated cache flush when dirops are active. Also,
make SET_ENDOP use lfs_check instead of inlining most of it.
Improve the debugging printfs in the cleaner syscalls (in particular, make
it obvious that they're coming from lfs).
Check the superblock version field, and refuse to mount the filesystem if
the version number is higher than we know about. This allows, e.g.,
changes in the format of the ifile, segment size restrictions and
boundaries, etc., which would not affect existing fields in the
superblock, but which would drastically affect the filesystem, to be
smoothly integrated at a later date.
diffstat:
sys/ufs/lfs/lfs_alloc.c | 44 ++------------------------------------------
1 files changed, 2 insertions(+), 42 deletions(-)
diffs (107 lines):
diff -r 085fcf256cc4 -r 78d6d5796e8a sys/ufs/lfs/lfs_alloc.c
--- a/sys/ufs/lfs/lfs_alloc.c Tue Apr 13 20:24:09 1999 +0000
+++ b/sys/ufs/lfs/lfs_alloc.c Tue Apr 13 21:33:54 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_alloc.c,v 1.18 1999/03/24 05:51:30 mrg Exp $ */
+/* $NetBSD: lfs_alloc.c,v 1.18.2.1 1999/04/13 21:33:55 perseant Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -94,11 +94,7 @@
#include <ufs/lfs/lfs.h>
#include <ufs/lfs/lfs_extern.h>
-#ifndef USE_UFS_HASHLOCK
-int free_lock = 0;
-#else
extern struct lock ufs_hashlock;
-#endif
/* Allocate a new inode. */
/* ARGSUSED */
@@ -129,14 +125,8 @@
* (this should be a proper lock, in struct lfs)
*/
-#ifndef USE_UFS_HASHLOCK
- while(free_lock)
- tsleep(&free_lock, PRIBIO+1, "lfs_free", 0);
- free_lock++;
-#else
while(lockmgr(&ufs_hashlock, LK_EXCLUSIVE|LK_SLEEPFAIL, 0))
;
-#endif
/* Get the head of the freelist. */
new_ino = fs->lfs_free;
@@ -190,22 +180,11 @@
ifp->if_nextfree = LFS_UNUSED_INUM;
VOP_UNLOCK(vp,0);
if ((error = VOP_BWRITE(bp)) != 0) {
-#ifndef USE_UFS_HASHLOCK
- free_lock--;
- wakeup(&free_lock);
-#else
lockmgr(&ufs_hashlock, LK_RELEASE, 0);
-#endif
return (error);
}
}
-
-#ifndef USE_UFS_HASHLOCK
- free_lock--;
- wakeup(&free_lock);
-#else
lockmgr(&ufs_hashlock, LK_RELEASE, 0);
-#endif
#ifdef DIAGNOSTIC
if(fs->lfs_free == LFS_UNUSED_INUM)
@@ -321,33 +300,19 @@
while(WRITEINPROG(ap->a_pvp)
|| fs->lfs_seglock
-#ifndef USE_UFS_HASHLOCK
- || free_lock
-#else
- || lockmgr(&ufs_hashlock, LK_EXCLUSIVE|LK_SLEEPFAIL, 0)
-#endif
- )
+ || lockmgr(&ufs_hashlock, LK_EXCLUSIVE|LK_SLEEPFAIL, 0))
{
if (WRITEINPROG(ap->a_pvp)) {
tsleep(ap->a_pvp, (PRIBIO+1), "lfs_vfree", 0);
}
- if(free_lock)
- tsleep(&free_lock, PRIBIO+1, "free_lock", 0);
if (fs->lfs_seglock) {
if (fs->lfs_lockpid == curproc->p_pid) {
-#if 0
- panic("lfs_vfree: we hold the seglock");
-#else
break;
-#endif
} else {
tsleep(&fs->lfs_seglock, PRIBIO + 1, "lfs_vfr1", 0);
}
}
}
-#ifndef USE_UFS_HASHLOCK
- free_lock++;
-#endif
if (ip->i_flag & IN_CLEANING) {
--fs->lfs_uinodes;
@@ -392,12 +357,7 @@
sup->su_nbytes -= DINODE_SIZE;
(void) VOP_BWRITE(bp);
}
-#ifndef USE_UFS_HASHLOCK
- free_lock--;
- wakeup(&free_lock);
-#else
lockmgr(&ufs_hashlock, LK_RELEASE, 0);
-#endif
/* Set superblock modified bit and decrement file count. */
fs->lfs_fmod = 1;
Home |
Main Index |
Thread Index |
Old Index