version 1.21.8.2, 2008/06/17 09:15:17 |
version 1.23, 2008/06/04 11:33:19 |
Line 163 ufsdirhash_build(struct inode *ip) |
|
Line 163 ufsdirhash_build(struct inode *ip) |
|
/* Try to free some space. */ |
/* Try to free some space. */ |
if (ufsdirhash_recycle(memreqd) != 0) |
if (ufsdirhash_recycle(memreqd) != 0) |
return (-1); |
return (-1); |
else |
|
DIRHASHLIST_UNLOCK(); |
|
} |
} |
|
|
/* |
/* |
Line 178 ufsdirhash_build(struct inode *ip) |
|
Line 176 ufsdirhash_build(struct inode *ip) |
|
} |
} |
memset(dh, 0, sizeof(*dh)); |
memset(dh, 0, sizeof(*dh)); |
mutex_init(&dh->dh_lock, MUTEX_DEFAULT, IPL_NONE); |
mutex_init(&dh->dh_lock, MUTEX_DEFAULT, IPL_NONE); |
DIRHASH_LOCK(dh); |
|
dh->dh_hashsz = narrays * sizeof(dh->dh_hash[0]); |
dh->dh_hashsz = narrays * sizeof(dh->dh_hash[0]); |
dh->dh_hash = kmem_zalloc(dh->dh_hashsz, KM_NOSLEEP); |
dh->dh_hash = kmem_zalloc(dh->dh_hashsz, KM_NOSLEEP); |
dh->dh_blkfreesz = nblocks * sizeof(dh->dh_blkfree[0]); |
dh->dh_blkfreesz = nblocks * sizeof(dh->dh_blkfree[0]); |
Line 248 ufsdirhash_build(struct inode *ip) |
|
Line 245 ufsdirhash_build(struct inode *ip) |
|
DIRHASHLIST_LOCK(); |
DIRHASHLIST_LOCK(); |
TAILQ_INSERT_TAIL(&ufsdirhash_list, dh, dh_list); |
TAILQ_INSERT_TAIL(&ufsdirhash_list, dh, dh_list); |
dh->dh_onlist = 1; |
dh->dh_onlist = 1; |
DIRHASH_UNLOCK(dh); |
|
DIRHASHLIST_UNLOCK(); |
DIRHASHLIST_UNLOCK(); |
return (0); |
return (0); |
|
|
Line 1085 ufsdirhash_recycle(int wanted) |
|
Line 1081 ufsdirhash_recycle(int wanted) |
|
DIRHASHLIST_LOCK(); |
DIRHASHLIST_LOCK(); |
ufs_dirhashmem -= mem; |
ufs_dirhashmem -= mem; |
} |
} |
|
DIRHASHLIST_LOCK(); |
/* Success. */ |
/* Success. */ |
return (0); |
return (0); |
} |
} |