Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Move simple_lock after the hashinit's to avoid poss...
details: https://anonhg.NetBSD.org/src/rev/e9bda311c4b4
branches: trunk
changeset: 543231:e9bda311c4b4
user: jmc <jmc%NetBSD.org@localhost>
date: Thu Feb 20 02:49:51 2003 +0000
description:
Move simple_lock after the hashinit's to avoid possible sleeping/malloc'ing
with a simplelock held.
diffstat:
sys/kern/vfs_cache.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (34 lines):
diff -r e08b3a0d94ad -r e9bda311c4b4 sys/kern/vfs_cache.c
--- a/sys/kern/vfs_cache.c Thu Feb 20 00:55:21 2003 +0000
+++ b/sys/kern/vfs_cache.c Thu Feb 20 02:49:51 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vfs_cache.c,v 1.39 2003/02/14 21:39:46 pk Exp $ */
+/* $NetBSD: vfs_cache.c,v 1.40 2003/02/20 02:49:51 jmc Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.39 2003/02/14 21:39:46 pk Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.40 2003/02/20 02:49:51 jmc Exp $");
#include "opt_ddb.h"
#include "opt_revcache.h"
@@ -453,7 +453,6 @@
struct ncvhashhead *oldhash2, *hash2;
u_long i, oldmask1, oldmask2, mask1, mask2;
- simple_lock(&namecache_slock);
hash1 = hashinit(desiredvnodes, HASH_LIST, M_CACHE, M_WAITOK, &mask1);
hash2 =
#ifdef NAMECACHE_ENTER_REVERSE
@@ -461,6 +460,7 @@
#else
hashinit(desiredvnodes/8, HASH_LIST, M_CACHE, M_WAITOK, &mask2);
#endif
+ simple_lock(&namecache_slock);
oldhash1 = nchashtbl;
oldmask1 = nchash;
nchashtbl = hash1;
Home |
Main Index |
Thread Index |
Old Index