diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2006-04-29 23:09:46 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2006-04-29 23:09:46 +0000 |
commit | 8427d9b463e324e246e4233149fe63bcc7ecc6fb (patch) | |
tree | f28267664373ac85c91316e7459715a632e8c98d /sys | |
parent | 424fe0e4fa0133fc05db8bbf577c5e66bb99568d (diff) |
no need for using rwlocks in dirhash. i was confused about the purpose
freebsd's mutexes served here, but they are only for smp protection.
the code is careful not to block and needs no rwlocks.
ok pedro and an assortment of testers
Diffstat (limited to 'sys')
-rw-r--r-- | sys/ufs/ufs/dirhash.h | 4 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_dirhash.c | 13 |
2 files changed, 6 insertions, 11 deletions
diff --git a/sys/ufs/ufs/dirhash.h b/sys/ufs/ufs/dirhash.h index f738922ace7..1e96225b5e3 100644 --- a/sys/ufs/ufs/dirhash.h +++ b/sys/ufs/ufs/dirhash.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dirhash.h,v 1.3 2004/02/02 19:34:39 tedu Exp $ */ +/* $OpenBSD: dirhash.h,v 1.4 2006/04/29 23:09:45 tedu Exp $ */ /* * Copyright (c) 2001 Ian Dowse. All rights reserved. * @@ -83,8 +83,6 @@ ((dh)->dh_hash[(slot) >> DH_BLKOFFSHIFT][(slot) & DH_BLKOFFMASK]) struct dirhash { - struct rwlock dh_mtx; /* protects all fields except dh_list */ - doff_t **dh_hash; /* the hash array (2-level) */ int dh_narrays; /* number of entries in dh_hash */ int dh_hlen; /* total slots in the 2-level hash array */ diff --git a/sys/ufs/ufs/ufs_dirhash.c b/sys/ufs/ufs/ufs_dirhash.c index 98b301799e5..c60e06f0486 100644 --- a/sys/ufs/ufs/ufs_dirhash.c +++ b/sys/ufs/ufs/ufs_dirhash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_dirhash.c,v 1.11 2005/12/28 20:48:18 pedro Exp $ */ +/* $OpenBSD: ufs_dirhash.c,v 1.12 2006/04/29 23:09:45 tedu Exp $ */ /* * Copyright (c) 2001, 2002 Ian Dowse. All rights reserved. * @@ -74,10 +74,10 @@ int ufsdirhash_recycle(int wanted); struct pool ufsdirhash_pool; -#define DIRHASHLIST_LOCK() rw_enter_write(&ufsdirhash_mtx) -#define DIRHASHLIST_UNLOCK() rw_exit_write(&ufsdirhash_mtx) -#define DIRHASH_LOCK(dh) rw_enter_write(&(dh)->dh_mtx) -#define DIRHASH_UNLOCK(dh) rw_exit_write(&(dh)->dh_mtx) +#define DIRHASHLIST_LOCK() +#define DIRHASHLIST_UNLOCK() +#define DIRHASH_LOCK(dh) +#define DIRHASH_UNLOCK(dh) #define DIRHASH_BLKALLOC_WAITOK() pool_get(&ufsdirhash_pool, PR_WAITOK) #define DIRHASH_BLKFREE(v) pool_put(&ufsdirhash_pool, v) @@ -88,7 +88,6 @@ struct pool ufsdirhash_pool; TAILQ_HEAD(, dirhash) ufsdirhash_list; /* Protects: ufsdirhash_list, `dh_list' field, ufs_dirhashmem. */ -struct rwlock ufsdirhash_mtx; /* * Locking order: @@ -190,7 +189,6 @@ ufsdirhash_build(struct inode *ip) } /* Initialise the hash table and block statistics. */ - rw_init(&dh->dh_mtx); dh->dh_narrays = narrays; dh->dh_hlen = nslots; dh->dh_nblk = nblocks; @@ -1063,7 +1061,6 @@ ufsdirhash_init() pool_init(&ufsdirhash_pool, DH_NBLKOFF * sizeof(doff_t), 0, 0, 0, "dirhash", &pool_allocator_nointr); pool_sethiwat(&ufsdirhash_pool, 512); - rw_init(&ufsdirhash_mtx); TAILQ_INIT(&ufsdirhash_list); #if defined (__sparc__) if (!CPU_ISSUN4OR4C) |