mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 13:38:01 +00:00
aix-unpin-after-free-20080520
LICENSE IPL10 FIXES 99456 in order that cleanup be safe we need to do it this way
This commit is contained in:
parent
090b2eebfa
commit
3edb97360b
@ -1016,10 +1016,10 @@ afs_icl_LogFreeUse(register struct afs_icl_log *logp)
|
||||
ObtainWriteLock(&logp->lock, 189);
|
||||
if (--logp->setCount == 0) {
|
||||
/* no more users -- free it (but keep log structure around) */
|
||||
afs_osi_Free(logp->datap, sizeof(afs_int32) * logp->logSize);
|
||||
#ifdef KERNEL_HAVE_PIN
|
||||
unpin((char *)logp->datap, sizeof(afs_int32) * logp->logSize);
|
||||
#endif
|
||||
afs_osi_Free(logp->datap, sizeof(afs_int32) * logp->logSize);
|
||||
logp->firstUsed = logp->firstFree = 0;
|
||||
logp->logElements = 0;
|
||||
logp->datap = NULL;
|
||||
@ -1042,10 +1042,10 @@ afs_icl_LogSetSize(register struct afs_icl_log *logp, afs_int32 logSize)
|
||||
logp->logElements = 0;
|
||||
|
||||
/* free and allocate a new one */
|
||||
afs_osi_Free(logp->datap, sizeof(afs_int32) * logp->logSize);
|
||||
#ifdef KERNEL_HAVE_PIN
|
||||
unpin((char *)logp->datap, sizeof(afs_int32) * logp->logSize);
|
||||
#endif
|
||||
afs_osi_Free(logp->datap, sizeof(afs_int32) * logp->logSize);
|
||||
logp->datap =
|
||||
(afs_int32 *) afs_osi_Alloc(sizeof(afs_int32) * logSize);
|
||||
#ifdef KERNEL_HAVE_PIN
|
||||
@ -1069,10 +1069,10 @@ afs_icl_ZapLog(register struct afs_icl_log *logp)
|
||||
/* found the dude we want to remove */
|
||||
*lpp = logp->nextp;
|
||||
osi_FreeSmallSpace(logp->name);
|
||||
afs_osi_Free(logp->datap, sizeof(afs_int32) * logp->logSize);
|
||||
#ifdef KERNEL_HAVE_PIN
|
||||
unpin((char *)logp->datap, sizeof(afs_int32) * logp->logSize);
|
||||
#endif
|
||||
afs_osi_Free(logp->datap, sizeof(afs_int32) * logp->logSize);
|
||||
osi_FreeSmallSpace(logp);
|
||||
break; /* won't find it twice */
|
||||
}
|
||||
@ -1330,10 +1330,10 @@ afs_icl_ZapSet(register struct afs_icl_set *setp)
|
||||
/* found the dude we want to remove */
|
||||
*lpp = setp->nextp;
|
||||
osi_FreeSmallSpace(setp->name);
|
||||
afs_osi_Free(setp->eventFlags, ICL_DEFAULTEVENTS);
|
||||
#ifdef KERNEL_HAVE_PIN
|
||||
unpin((char *)setp->eventFlags, ICL_DEFAULTEVENTS);
|
||||
#endif
|
||||
afs_osi_Free(setp->eventFlags, ICL_DEFAULTEVENTS);
|
||||
for (i = 0; i < ICL_LOGSPERSET; i++) {
|
||||
if ((tlp = setp->logs[i]))
|
||||
afs_icl_LogReleNL(tlp);
|
||||
|
@ -233,18 +233,18 @@ shutdown_osinet(void)
|
||||
|
||||
while ((tp = freePacketList)) {
|
||||
freePacketList = tp->next;
|
||||
afs_osi_Free(tp, AFS_LRALLOCSIZ);
|
||||
#ifdef KERNEL_HAVE_PIN
|
||||
unpin(tp, AFS_LRALLOCSIZ);
|
||||
#endif
|
||||
afs_osi_Free(tp, AFS_LRALLOCSIZ);
|
||||
}
|
||||
|
||||
while ((tp = freeSmallList)) {
|
||||
freeSmallList = tp->next;
|
||||
afs_osi_Free(tp, AFS_SMALLOCSIZ);
|
||||
#ifdef KERNEL_HAVE_PIN
|
||||
unpin(tp, AFS_SMALLOCSIZ);
|
||||
#endif
|
||||
afs_osi_Free(tp, AFS_SMALLOCSIZ);
|
||||
}
|
||||
LOCK_INIT(&osi_fsplock, "osi_fsplock");
|
||||
LOCK_INIT(&osi_flplock, "osi_flplock");
|
||||
|
@ -3087,12 +3087,12 @@ shutdown_vcache(void)
|
||||
}
|
||||
afs_cbrSpace = 0;
|
||||
|
||||
#ifdef KERNEL_HAVE_PIN
|
||||
unpin(Initial_freeVCList, afs_cacheStats * sizeof(struct vcache));
|
||||
#endif
|
||||
#if !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV)
|
||||
afs_osi_Free(Initial_freeVCList, afs_cacheStats * sizeof(struct vcache));
|
||||
#endif
|
||||
#ifdef KERNEL_HAVE_PIN
|
||||
unpin(Initial_freeVCList, afs_cacheStats * sizeof(struct vcache));
|
||||
#endif
|
||||
|
||||
#if !defined(AFS_OSF_ENV) && !defined(AFS_LINUX22_ENV)
|
||||
freeVCList = Initial_freeVCList = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user