version 1.4.2.4, 2007/10/27 11:36:51 |
version 1.20.4.1, 2008/02/18 21:07:32 |
Line 76 static doff_t ufsdirhash_getprev(struct |
|
Line 76 static doff_t ufsdirhash_getprev(struct |
|
int dirblksiz); |
int dirblksiz); |
static int ufsdirhash_recycle(int wanted); |
static int ufsdirhash_recycle(int wanted); |
|
|
static struct pool ufsdirhash_pool; |
static pool_cache_t ufsdirhash_cache; |
|
|
#define DIRHASHLIST_LOCK() mutex_enter(&ufsdirhash_lock) |
#define DIRHASHLIST_LOCK() mutex_enter(&ufsdirhash_lock) |
#define DIRHASHLIST_UNLOCK() mutex_exit(&ufsdirhash_lock) |
#define DIRHASHLIST_UNLOCK() mutex_exit(&ufsdirhash_lock) |
#define DIRHASH_LOCK(dh) mutex_enter(&(dh)->dh_lock) |
#define DIRHASH_LOCK(dh) mutex_enter(&(dh)->dh_lock) |
#define DIRHASH_UNLOCK(dh) mutex_exit(&(dh)->dh_lock) |
#define DIRHASH_UNLOCK(dh) mutex_exit(&(dh)->dh_lock) |
#define DIRHASH_BLKALLOC_WAITOK() pool_get(&ufsdirhash_pool, PR_WAITOK) |
#define DIRHASH_BLKALLOC_WAITOK() \ |
#define DIRHASH_BLKFREE(ptr) pool_put(&ufsdirhash_pool, ptr) |
pool_cache_get(ufsdirhash_cache, PR_WAITOK) |
|
#define DIRHASH_BLKFREE(ptr) \ |
|
pool_cache_put(ufsdirhash_cache, ptr) |
|
|
/* Dirhash list; recently-used entries are near the tail. */ |
/* Dirhash list; recently-used entries are near the tail. */ |
static TAILQ_HEAD(, dirhash) ufsdirhash_list; |
static TAILQ_HEAD(, dirhash) ufsdirhash_list; |
Line 1075 ufsdirhash_init() |
|
Line 1077 ufsdirhash_init() |
|
|
|
mutex_init(&ufsdirhash_lock, MUTEX_DEFAULT, IPL_NONE); |
mutex_init(&ufsdirhash_lock, MUTEX_DEFAULT, IPL_NONE); |
malloc_type_attach(M_DIRHASH); |
malloc_type_attach(M_DIRHASH); |
pool_init(&ufsdirhash_pool, DH_NBLKOFF * sizeof(daddr_t), 0, 0, 0, |
ufsdirhash_cache = pool_cache_init(DH_NBLKOFF * sizeof(daddr_t), 0, |
"ufsdirhash", &pool_allocator_nointr, IPL_NONE); |
0, 0, "ufsdirhash", NULL, IPL_NONE, NULL, NULL, NULL); |
TAILQ_INIT(&ufsdirhash_list); |
TAILQ_INIT(&ufsdirhash_list); |
} |
} |
|
|
Line 1085 ufsdirhash_done(void) |
|
Line 1087 ufsdirhash_done(void) |
|
{ |
{ |
|
|
KASSERT(TAILQ_EMPTY(&ufsdirhash_list)); |
KASSERT(TAILQ_EMPTY(&ufsdirhash_list)); |
pool_destroy(&ufsdirhash_pool); |
pool_cache_destroy(ufsdirhash_cache); |
malloc_type_detach(M_DIRHASH); |
malloc_type_detach(M_DIRHASH); |
mutex_destroy(&ufsdirhash_lock); |
mutex_destroy(&ufsdirhash_lock); |
} |
} |