afs-lock-init-20050320

FIXES 17939

add missing afs lock initialization
This commit is contained in:
Chaskiel M Grundman 2005-03-20 20:08:06 +00:00 committed by Derrick Brashear
parent 3b6e82294b
commit 1aa23c6653
2 changed files with 8 additions and 0 deletions

View File

@ -3227,8 +3227,14 @@ afs_dcacheInit(int afiles, int ablocks, int aDentries, int achunk, int aflags)
afs_freeDSList = &tdp[0];
for (i = 0; i < aDentries - 1; i++) {
tdp[i].lruq.next = (struct afs_q *)(&tdp[i + 1]);
RWLOCK_INIT(&tdp[i].lock, "dcache lock");
RWLOCK_INIT(&tdp[i].tlock, "dcache tlock");
RWLOCK_INIT(&tdp[i].mflock, "dcache flock");
}
tdp[aDentries - 1].lruq.next = (struct afs_q *)0;
RWLOCK_INIT(&tdp[aDentries - 1].lock, "dcache lock");
RWLOCK_INIT(&tdp[aDentries - 1].tlock, "dcache tlock");
RWLOCK_INIT(&tdp[aDentries - 1].mflock, "dcache flock");
afs_stats_cmperf.cacheBlocksOrig = afs_stats_cmperf.cacheBlocksTotal =
afs_cacheBlocks = ablocks;

View File

@ -614,6 +614,8 @@ afs_DynrootNewVnode(struct vcache *avc, struct AFSFetchStatus *status)
int
afs_SetDynrootEnable(int enable)
{
RWLOCK_INIT(&afs_dynrootDirLock, "afs_dynrootDirLock");
RWLOCK_INIT(&afs_dynSymlinkLock, "afs_dynSymlinkLock");
afs_dynrootEnable = enable;
return afs_dynrootCellInit();
}