struct afs_icl_log *logp;
struct afs_icl_set *setp;
- setp = afs_icl_FindSet("cm");
- if (setp) {
- /* Release the reference from Find, and the initial one */
- afs_icl_SetFree(setp);
+ if (afs_iclSetp) {
+ setp = afs_iclSetp; /* "cm" */
+ afs_iclSetp = NULL;
afs_icl_SetFree(setp);
}
- setp = afs_icl_FindSet("cmlongterm");
- if (setp) {
- /* Release the reference from Find, and the initial one */
- afs_icl_SetFree(setp);
+ if (afs_iclLongTermSetp) {
+ setp = afs_iclLongTermSetp; /* "cmlongterm" */
+ afs_iclLongTermSetp = NULL;
afs_icl_SetFree(setp);
}
logp = afs_icl_FindLog("cmfx");
/* initialize the ICL system */
code = afs_icl_CreateLog("cmfx", 60 * 1024, &logp);
- if (code == 0)
- code =
- afs_icl_CreateSetWithFlags("cm", logp, NULL,
- ICL_CRSET_FLAG_DEFAULT_OFF,
- &afs_iclSetp);
- code =
- afs_icl_CreateSet("cmlongterm", logp, NULL,
- &afs_iclLongTermSetp);
+ if (code)
+ return code;
+
+ code = afs_icl_CreateSetWithFlags("cm", logp, NULL,
+ ICL_CRSET_FLAG_DEFAULT_OFF,
+ &afs_iclSetp);
+ if (code)
+ return code;
+
+ code = afs_icl_CreateSet("cmlongterm", logp, NULL,
+ &afs_iclLongTermSetp);
return code;
}
if (!logp)
return ENOENT;
#define BUFFERSIZE AFS_LRALLOCSIZ
- lp = (afs_int32 *) osi_AllocLargeSpace(AFS_LRALLOCSIZ);
+ lp = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
elts = BUFFERSIZE / sizeof(afs_int32);
if (p3 < elts)
elts = p3;
setp = afs_icl_FindSet(tname);
if (!setp)
return ENOENT;
- if (p2 > ICL_LOGSPERSET)
+ if (p2 >= ICL_LOGSPERSET)
return EINVAL;
if (!(tlp = setp->logs[p2]))
return EBADF;
return 0;
AFS_ASSERT_GLOCK();
+ afs_icl_SetHold(setp);
mask = lAndT >> 24 & 0xff; /* mask of which logs to log to */
ix = ICL_EVENTBYTE(eventID);
ObtainReadLock(&setp->lock);
}
}
ReleaseReadLock(&setp->lock);
+ afs_icl_SetRele(setp);
return 0;
}
{
int rsize; /* record size in longs */
int tsize; /* temp size */
- osi_timeval_t tv;
+ osi_timeval32_t tv;
int t1, t2, t3, t4;
t4 = types & 0x3f; /* decode types */
}
}
- logp = (struct afs_icl_log *)
- osi_AllocSmallSpace(sizeof(struct afs_icl_log));
+ logp = osi_AllocSmallSpace(sizeof(struct afs_icl_log));
memset((caddr_t) logp, 0, sizeof(*logp));
logp->refCount = 1;
if (flags & ICL_CRSET_FLAG_PERSISTENT)
states |= ICL_SETF_PERSISTENT;
- setp = (struct afs_icl_set *)osi_AllocSmallSpace(sizeof(struct afs_icl_set));
+ setp = osi_AllocSmallSpace(sizeof(struct afs_icl_set));
memset((caddr_t) setp, 0, sizeof(*setp));
setp->refCount = 1;
if (states & ICL_SETF_FREED)