afs: remove dead ICL (fstrace) code
[openafs.git] / src / afs / afs_icl.c
index 0bfc3a3..dd77f36 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
 #ifdef AFS_SGI62_ENV
 #include "h/hashing.h"
 #endif
-#if !defined(AFS_HPUX110_ENV) && !defined(AFS_DARWIN60_ENV)
+#if !defined(AFS_HPUX110_ENV) && !defined(AFS_DARWIN_ENV)
 #include "netinet/in_var.h"
 #endif
 #endif /* !defined(UKERNEL) */
-#ifdef AFS_LINUX22_ENV
-#include "h/smp_lock.h"
-#endif
 
 
 struct afs_icl_set *afs_iclSetp = (struct afs_icl_set *)0;
 struct afs_icl_set *afs_iclLongTermSetp = (struct afs_icl_set *)0;
 
-#if defined(AFS_SGI61_ENV)
-/* For SGI 6.2, this can is changed to 1 if it's a 32 bit kernel. */
-#if defined(AFS_SGI62_ENV) && defined(KERNEL) && !defined(_K64U64)
-int afs_icl_sizeofLong = 1;
-#else
-int afs_icl_sizeofLong = 2;
-#endif /* SGI62 */
-#else
-#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)
-int afs_icl_sizeofLong = 2;
+/* Matches below where ICL_APPENDLONG is 2 INT32s */
+#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) || defined(AFS_DARWIN_ENV) && defined(__amd64__)
+#define ICL_LONG 2
 #else
-int afs_icl_sizeofLong = 1;
-#endif
+#define ICL_LONG 1
 #endif
 
+int afs_icl_sizeofLong = ICL_LONG;
+
 int afs_icl_inited = 0;
 
 /* init function, called once, under afs_icl_lock */
@@ -58,22 +49,20 @@ afs_icl_Init(void)
 }
 
 /* Function called at shutdown - zap everything */
-int
+void
 shutdown_icl(void)
 {
     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");
@@ -82,7 +71,6 @@ shutdown_icl(void)
        afs_icl_LogFree(logp);
        afs_icl_LogFree(logp);
     }
-    return 0;
 }
 
 int
@@ -93,14 +81,17 @@ afs_icl_InitLogs(void)
 
     /* 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;
 }
 
@@ -133,10 +124,10 @@ Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval)
 #endif
 {
     afs_int32 *lp, elts, flags;
-    register afs_int32 code;
+    afs_int32 code;
     struct afs_icl_log *logp;
     struct afs_icl_set *setp;
-#if defined(AFS_SGI61_ENV) || defined(AFS_SUN57_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
+#if defined(AFS_SGI61_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_XBSD_ENV)
     size_t temp;
 #else /* AFS_SGI61_ENV */
 #if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)
@@ -188,7 +179,7 @@ Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval)
        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;
@@ -247,7 +238,7 @@ Afscall_icl(long opcode, long p1, long p2, long p3, long p4, long *retval)
        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;
@@ -404,12 +395,12 @@ afs_lock_t afs_icl_lock;
 
 /* exported routine: a 4 parameter event */
 int
-afs_icl_Event4(register struct afs_icl_set *setp, afs_int32 eventID,
+afs_icl_Event4(struct afs_icl_set *setp, afs_int32 eventID,
               afs_int32 lAndT, long p1, long p2, long p3, long p4)
 {
     afs_int32 mask;
-    register int i;
-    register afs_int32 tmask;
+    int i;
+    afs_int32 tmask;
     int ix;
 
     /* If things aren't init'ed yet (or the set is inactive), don't panic */
@@ -417,6 +408,7 @@ afs_icl_Event4(register struct afs_icl_set *setp, afs_int32 eventID,
        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);
@@ -432,6 +424,7 @@ afs_icl_Event4(register struct afs_icl_set *setp, afs_int32 eventID,
        }
     }
     ReleaseReadLock(&setp->lock);
+    afs_icl_SetRele(setp);
     return 0;
 }
 
@@ -440,21 +433,21 @@ afs_icl_Event4(register struct afs_icl_set *setp, afs_int32 eventID,
  * Otherwise, could call afs_icl_Event4 directly.
  */
 int
-afs_icl_Event3(register struct afs_icl_set *setp, afs_int32 eventID,
+afs_icl_Event3(struct afs_icl_set *setp, afs_int32 eventID,
               afs_int32 lAndT, long p1, long p2, long p3)
 {
     return afs_icl_Event4(setp, eventID, lAndT, p1, p2, p3, (long)0);
 }
 
 int
-afs_icl_Event2(register struct afs_icl_set *setp, afs_int32 eventID,
+afs_icl_Event2(struct afs_icl_set *setp, afs_int32 eventID,
               afs_int32 lAndT, long p1, long p2)
 {
     return afs_icl_Event4(setp, eventID, lAndT, p1, p2, (long)0, (long)0);
 }
 
 int
-afs_icl_Event1(register struct afs_icl_set *setp, afs_int32 eventID,
+afs_icl_Event1(struct afs_icl_set *setp, afs_int32 eventID,
               afs_int32 lAndT, long p1)
 {
     return afs_icl_Event4(setp, eventID, lAndT, p1, (long)0, (long)0,
@@ -462,7 +455,7 @@ afs_icl_Event1(register struct afs_icl_set *setp, afs_int32 eventID,
 }
 
 int
-afs_icl_Event0(register struct afs_icl_set *setp, afs_int32 eventID,
+afs_icl_Event0(struct afs_icl_set *setp, afs_int32 eventID,
               afs_int32 lAndT)
 {
     return afs_icl_Event4(setp, eventID, lAndT, (long)0, (long)0, (long)0,
@@ -478,9 +471,9 @@ struct afs_icl_log *afs_icl_allLogs = 0;
  * Log must be write-locked.
  */
 static void
-afs_icl_GetLogSpace(register struct afs_icl_log *logp, afs_int32 minSpace)
+afs_icl_GetLogSpace(struct afs_icl_log *logp, afs_int32 minSpace)
 {
-    register unsigned int tsize;
+    unsigned int tsize;
 
     while (logp->logSize - logp->logElements <= minSpace) {
        /* eat a record */
@@ -503,7 +496,7 @@ afs_icl_AppendString(struct afs_icl_log *logp, char *astr)
 {
     char *op;                  /* ptr to char to write */
     int tc;
-    register int bib;          /* bytes in buffer */
+    int bib;           /* bytes in buffer */
 
     bib = 0;
     op = (char *)&(logp->datap[logp->firstFree]);
@@ -541,7 +534,7 @@ afs_icl_AppendString(struct afs_icl_log *logp, char *astr)
         (lp)->logElements++; \
     MACRO_END
 
-#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)) || defined(AFS_DARWIN_ENV) && defined(__amd64__)
+#if ICL_LONG == 2
 #define ICL_APPENDLONG(lp, x) \
     MACRO_BEGIN \
        ICL_APPENDINT32((lp), ((x) >> 32) & 0xffffffffL); \
@@ -552,17 +545,50 @@ afs_icl_AppendString(struct afs_icl_log *logp, char *astr)
 #define ICL_APPENDLONG(lp, x) ICL_APPENDINT32((lp), (x))
 #endif
 
-/* routine to tell whether we're dealing with the address or the
- * object itself
- */
-int
-afs_icl_UseAddr(int type)
+
+void
+afs_icl_AppendOne(struct afs_icl_log *logp, int type, long parm)
 {
-    if (type == ICL_TYPE_HYPER || type == ICL_TYPE_STRING
-       || type == ICL_TYPE_FID || type == ICL_TYPE_INT64)
-       return 1;
-    else
-       return 0;
+    if (type) {
+       /* marshall parameter 3 now */
+       if (type == ICL_TYPE_STRING)
+           afs_icl_AppendString(logp, (char *)parm);
+       else if (type == ICL_TYPE_HYPER) {
+           ICL_APPENDINT32(logp,
+                           (afs_int32) ((struct afs_hyper_t *)parm)->high);
+           ICL_APPENDINT32(logp,
+                           (afs_int32) ((struct afs_hyper_t *)parm)->low);
+       } else if (type == ICL_TYPE_INT64) {
+#ifndef WORDS_BIGENDIAN
+#ifdef AFS_64BIT_CLIENT
+           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) parm)[1]);
+           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) parm)[0]);
+#else /* AFS_64BIT_CLIENT */
+           ICL_APPENDINT32(logp, (afs_int32) parm);
+           ICL_APPENDINT32(logp, (afs_int32) 0);
+#endif /* AFS_64BIT_CLIENT */
+#else /* AFSLITTLE_ENDIAN */
+#ifdef AFS_64BIT_CLIENT
+           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) parm)[0]);
+           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) parm)[1]);
+#else /* AFS_64BIT_CLIENT */
+           ICL_APPENDINT32(logp, (afs_int32) 0);
+           ICL_APPENDINT32(logp, (afs_int32) parm);
+#endif /* AFS_64BIT_CLIENT */
+#endif /* AFSLITTLE_ENDIAN */
+       } else if (type == ICL_TYPE_FID) {
+           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) parm)[0]);
+           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) parm)[1]);
+           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) parm)[2]);
+           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) parm)[3]);
+       }
+#if ICL_LONG == 2
+       else if (type == ICL_TYPE_INT32)
+           ICL_APPENDINT32(logp, (afs_int32) parm);
+#endif
+       else
+           ICL_APPENDLONG(logp, parm);
+    }
 }
 
 /* Function to append a record to the log.  Written for speed
@@ -571,12 +597,12 @@ afs_icl_UseAddr(int type)
  */
 
 void
-afs_icl_AppendRecord(register struct afs_icl_log *logp, afs_int32 op,
+afs_icl_AppendRecord(struct afs_icl_log *logp, afs_int32 op,
                     afs_int32 types, long p1, long p2, long p3, long p4)
 {
     int rsize;                 /* record size in longs */
-    register int tsize;                /* temp size */
-    osi_timeval_t tv;
+    int tsize;         /* temp size */
+    osi_timeval32_t tv;
     int t1, t2, t3, t4;
 
     t4 = types & 0x3f;         /* decode types */
@@ -615,30 +641,30 @@ afs_icl_AppendRecord(register struct afs_icl_log *logp, afs_int32 op,
        logp->lastTS = tv.tv_sec;
     }
 
-    rsize = 4;                 /* base case */
+    rsize = 4;                 /* base case: see 4 items below */
     if (t1) {
        /* compute size of parameter p1.  Only tricky case is string.
         * In that case, we have to call strlen to get the string length.
         */
-       ICL_SIZEHACK(t1, p1);
+       ICL_SIZEHACK(t1, p1, tsize, rsize);
     }
     if (t2) {
        /* compute size of parameter p2.  Only tricky case is string.
         * In that case, we have to call strlen to get the string length.
         */
-       ICL_SIZEHACK(t2, p2);
+       ICL_SIZEHACK(t2, p2, tsize, rsize);
     }
     if (t3) {
        /* compute size of parameter p3.  Only tricky case is string.
         * In that case, we have to call strlen to get the string length.
         */
-       ICL_SIZEHACK(t3, p3);
+       ICL_SIZEHACK(t3, p3, tsize, rsize);
     }
     if (t4) {
        /* compute size of parameter p4.  Only tricky case is string.
         * In that case, we have to call strlen to get the string length.
         */
-       ICL_SIZEHACK(t4, p4);
+       ICL_SIZEHACK(t4, p4, tsize, rsize);
     }
 
     /* At this point, we've computed all of the parameter sizes, and
@@ -662,166 +688,10 @@ afs_icl_AppendRecord(register struct afs_icl_log *logp, afs_int32 op,
     ICL_APPENDINT32(logp,
                    (afs_int32) (tv.tv_sec & 0x3ff) * 1000000 + tv.tv_usec);
 
-    if (t1) {
-       /* marshall parameter 1 now */
-       if (t1 == ICL_TYPE_STRING) {
-           afs_icl_AppendString(logp, (char *)p1);
-       } else if (t1 == ICL_TYPE_HYPER) {
-           ICL_APPENDINT32(logp,
-                           (afs_int32) ((struct afs_hyper_t *)p1)->high);
-           ICL_APPENDINT32(logp,
-                           (afs_int32) ((struct afs_hyper_t *)p1)->low);
-       } else if (t1 == ICL_TYPE_INT64) {
-#ifndef WORDS_BIGENDIAN
-#ifdef AFS_64BIT_CLIENT
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[1]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[0]);
-#else /* AFS_64BIT_CLIENT */
-           ICL_APPENDINT32(logp, (afs_int32) p1);
-           ICL_APPENDINT32(logp, (afs_int32) 0);
-#endif /* AFS_64BIT_CLIENT */
-#else /* AFSLITTLE_ENDIAN */
-#ifdef AFS_64BIT_CLIENT
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[0]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[1]);
-#else /* AFS_64BIT_CLIENT */
-           ICL_APPENDINT32(logp, (afs_int32) 0);
-           ICL_APPENDINT32(logp, (afs_int32) p1);
-#endif /* AFS_64BIT_CLIENT */
-#endif /* AFSLITTLE_ENDIAN */
-       } else if (t1 == ICL_TYPE_FID) {
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[0]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[1]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[2]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p1)[3]);
-       }
-#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
-       else if (t1 == ICL_TYPE_INT32)
-           ICL_APPENDINT32(logp, (afs_int32) p1);
-#endif
-       else
-           ICL_APPENDLONG(logp, p1);
-    }
-    if (t2) {
-       /* marshall parameter 2 now */
-       if (t2 == ICL_TYPE_STRING)
-           afs_icl_AppendString(logp, (char *)p2);
-       else if (t2 == ICL_TYPE_HYPER) {
-           ICL_APPENDINT32(logp,
-                           (afs_int32) ((struct afs_hyper_t *)p2)->high);
-           ICL_APPENDINT32(logp,
-                           (afs_int32) ((struct afs_hyper_t *)p2)->low);
-       } else if (t2 == ICL_TYPE_INT64) {
-#ifndef WORDS_BIGENDIAN
-#ifdef AFS_64BIT_CLIENT
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[1]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[0]);
-#else /* AFS_64BIT_CLIENT */
-           ICL_APPENDINT32(logp, (afs_int32) p2);
-           ICL_APPENDINT32(logp, (afs_int32) 0);
-#endif /* AFS_64BIT_CLIENT */
-#else /* AFSLITTLE_ENDIAN */
-#ifdef AFS_64BIT_CLIENT
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[0]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[1]);
-#else /* AFS_64BIT_CLIENT */
-           ICL_APPENDINT32(logp, (afs_int32) 0);
-           ICL_APPENDINT32(logp, (afs_int32) p2);
-#endif /* AFS_64BIT_CLIENT */
-#endif /* AFSLITTLE_ENDIAN */
-       } else if (t2 == ICL_TYPE_FID) {
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[0]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[1]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[2]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p2)[3]);
-       }
-#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
-       else if (t2 == ICL_TYPE_INT32)
-           ICL_APPENDINT32(logp, (afs_int32) p2);
-#endif
-       else
-           ICL_APPENDLONG(logp, p2);
-    }
-    if (t3) {
-       /* marshall parameter 3 now */
-       if (t3 == ICL_TYPE_STRING)
-           afs_icl_AppendString(logp, (char *)p3);
-       else if (t3 == ICL_TYPE_HYPER) {
-           ICL_APPENDINT32(logp,
-                           (afs_int32) ((struct afs_hyper_t *)p3)->high);
-           ICL_APPENDINT32(logp,
-                           (afs_int32) ((struct afs_hyper_t *)p3)->low);
-       } else if (t3 == ICL_TYPE_INT64) {
-#ifndef WORDS_BIGENDIAN
-#ifdef AFS_64BIT_CLIENT
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[1]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[0]);
-#else /* AFS_64BIT_CLIENT */
-           ICL_APPENDINT32(logp, (afs_int32) p3);
-           ICL_APPENDINT32(logp, (afs_int32) 0);
-#endif /* AFS_64BIT_CLIENT */
-#else /* AFSLITTLE_ENDIAN */
-#ifdef AFS_64BIT_CLIENT
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[0]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[1]);
-#else /* AFS_64BIT_CLIENT */
-           ICL_APPENDINT32(logp, (afs_int32) 0);
-           ICL_APPENDINT32(logp, (afs_int32) p3);
-#endif /* AFS_64BIT_CLIENT */
-#endif /* AFSLITTLE_ENDIAN */
-       } else if (t3 == ICL_TYPE_FID) {
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[0]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[1]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[2]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p3)[3]);
-       }
-#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
-       else if (t3 == ICL_TYPE_INT32)
-           ICL_APPENDINT32(logp, (afs_int32) p3);
-#endif
-       else
-           ICL_APPENDLONG(logp, p3);
-    }
-    if (t4) {
-       /* marshall parameter 4 now */
-       if (t4 == ICL_TYPE_STRING)
-           afs_icl_AppendString(logp, (char *)p4);
-       else if (t4 == ICL_TYPE_HYPER) {
-           ICL_APPENDINT32(logp,
-                           (afs_int32) ((struct afs_hyper_t *)p4)->high);
-           ICL_APPENDINT32(logp,
-                           (afs_int32) ((struct afs_hyper_t *)p4)->low);
-       } else if (t4 == ICL_TYPE_INT64) {
-#ifndef WORDS_BIGENDIAN
-#ifdef AFS_64BIT_CLIENT
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[1]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[0]);
-#else /* AFS_64BIT_CLIENT */
-           ICL_APPENDINT32(logp, (afs_int32) p4);
-           ICL_APPENDINT32(logp, (afs_int32) 0);
-#endif /* AFS_64BIT_CLIENT */
-#else /* AFSLITTLE_ENDIAN */
-#ifdef AFS_64BIT_CLIENT
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[0]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[1]);
-#else /* AFS_64BIT_CLIENT */
-           ICL_APPENDINT32(logp, (afs_int32) 0);
-           ICL_APPENDINT32(logp, (afs_int32) p4);
-#endif /* AFS_64BIT_CLIENT */
-#endif /* AFSLITTLE_ENDIAN */
-       } else if (t4 == ICL_TYPE_FID) {
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[0]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[1]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[2]);
-           ICL_APPENDINT32(logp, (afs_int32) ((afs_int32 *) p4)[3]);
-       }
-#if (defined(AFS_SGI61_ENV) && (_MIPS_SZLONG==64)) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
-       else if (t4 == ICL_TYPE_INT32)
-           ICL_APPENDINT32(logp, (afs_int32) p4);
-#endif
-       else
-           ICL_APPENDLONG(logp, p4);
-    }
+    afs_icl_AppendOne(logp, t1, p1);
+    afs_icl_AppendOne(logp, t2, p2);
+    afs_icl_AppendOne(logp, t3, p3);
+    afs_icl_AppendOne(logp, t4, p4);
     ReleaseWriteLock(&logp->lock);
 }
 
@@ -842,7 +712,7 @@ int
 afs_icl_CreateLogWithFlags(char *name, afs_int32 logSize, afs_uint32 flags,
                           struct afs_icl_log **outLogpp)
 {
-    register struct afs_icl_log *logp;
+    struct afs_icl_log *logp;
 
     /* add into global list under lock */
     ObtainWriteLock(&afs_icl_lock, 183);
@@ -864,8 +734,7 @@ afs_icl_CreateLogWithFlags(char *name, afs_int32 logSize, afs_uint32 flags,
        }
     }
 
-    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;
@@ -893,7 +762,7 @@ afs_icl_CreateLogWithFlags(char *name, afs_int32 logSize, afs_uint32 flags,
  * find the record with cookie value cookie.
  */
 int
-afs_icl_CopyOut(register struct afs_icl_log *logp, afs_int32 * bufferp,
+afs_icl_CopyOut(struct afs_icl_log *logp, afs_int32 * bufferp,
                afs_int32 * bufSizep, afs_uint32 * cookiep,
                afs_int32 * flagsp)
 {
@@ -1008,22 +877,9 @@ afs_icl_CopyOut(register struct afs_icl_log *logp, afs_int32 * bufferp,
     return code;
 }
 
-/* return basic parameter information about a log */
-int
-afs_icl_GetLogParms(struct afs_icl_log *logp, afs_int32 * maxSizep,
-                   afs_int32 * curSizep)
-{
-    ObtainReadLock(&logp->lock);
-    *maxSizep = logp->logSize;
-    *curSizep = logp->logElements;
-    ReleaseReadLock(&logp->lock);
-    return 0;
-}
-
-
 /* hold and release logs */
 int
-afs_icl_LogHold(register struct afs_icl_log *logp)
+afs_icl_LogHold(struct afs_icl_log *logp)
 {
     ObtainWriteLock(&afs_icl_lock, 187);
     logp->refCount++;
@@ -1031,17 +887,9 @@ afs_icl_LogHold(register struct afs_icl_log *logp)
     return 0;
 }
 
-/* hold and release logs, called with lock already held */
-int
-afs_icl_LogHoldNL(register struct afs_icl_log *logp)
-{
-    logp->refCount++;
-    return 0;
-}
-
 /* keep track of how many sets believe the log itself is allocated */
 int
-afs_icl_LogUse(register struct afs_icl_log *logp)
+afs_icl_LogUse(struct afs_icl_log *logp)
 {
     ObtainWriteLock(&logp->lock, 188);
     if (logp->setCount == 0) {
@@ -1050,8 +898,8 @@ afs_icl_LogUse(register struct afs_icl_log *logp)
            /* we weren't passed in a hint and it wasn't set */
            logp->logSize = ICL_DEFAULT_LOGSIZE;
        }
-       logp->datap =
-           (afs_int32 *) afs_osi_Alloc(sizeof(afs_int32) * logp->logSize);
+       logp->datap = afs_osi_Alloc(sizeof(afs_int32) * logp->logSize);
+       osi_Assert(logp->datap != NULL);
 #ifdef KERNEL_HAVE_PIN
        pin((char *)logp->datap, sizeof(afs_int32) * logp->logSize);
 #endif
@@ -1063,7 +911,7 @@ afs_icl_LogUse(register struct afs_icl_log *logp)
 
 /* decrement the number of real users of the log, free if possible */
 int
-afs_icl_LogFreeUse(register struct afs_icl_log *logp)
+afs_icl_LogFreeUse(struct afs_icl_log *logp)
 {
     ObtainWriteLock(&logp->lock, 189);
     if (--logp->setCount == 0) {
@@ -1082,7 +930,7 @@ afs_icl_LogFreeUse(register struct afs_icl_log *logp)
 
 /* set the size of the log to 'logSize' */
 int
-afs_icl_LogSetSize(register struct afs_icl_log *logp, afs_int32 logSize)
+afs_icl_LogSetSize(struct afs_icl_log *logp, afs_int32 logSize)
 {
     ObtainWriteLock(&logp->lock, 190);
     if (!logp->datap) {
@@ -1098,8 +946,8 @@ afs_icl_LogSetSize(register struct afs_icl_log *logp, afs_int32 logSize)
 #ifdef KERNEL_HAVE_PIN
        unpin((char *)logp->datap, sizeof(afs_int32) * logp->logSize);
 #endif
-       logp->datap =
-           (afs_int32 *) afs_osi_Alloc(sizeof(afs_int32) * logSize);
+       logp->datap = afs_osi_Alloc(sizeof(afs_int32) * logSize);
+       osi_Assert(logp->datap != NULL);
 #ifdef KERNEL_HAVE_PIN
        pin((char *)logp->datap, sizeof(afs_int32) * logSize);
 #endif
@@ -1112,9 +960,9 @@ afs_icl_LogSetSize(register struct afs_icl_log *logp, afs_int32 logSize)
 
 /* free a log.  Called with afs_icl_lock locked. */
 int
-afs_icl_ZapLog(register struct afs_icl_log *logp)
+afs_icl_ZapLog(struct afs_icl_log *logp)
 {
-    register struct afs_icl_log **lpp, *tp;
+    struct afs_icl_log **lpp, *tp;
 
     for (lpp = &afs_icl_allLogs, tp = *lpp; tp; lpp = &tp->nextp, tp = *lpp) {
        if (tp == logp) {
@@ -1134,7 +982,7 @@ afs_icl_ZapLog(register struct afs_icl_log *logp)
 
 /* do the release, watching for deleted entries */
 int
-afs_icl_LogRele(register struct afs_icl_log *logp)
+afs_icl_LogRele(struct afs_icl_log *logp)
 {
     ObtainWriteLock(&afs_icl_lock, 191);
     if (--logp->refCount == 0 && (logp->states & ICL_LOGF_DELETED)) {
@@ -1146,7 +994,7 @@ afs_icl_LogRele(register struct afs_icl_log *logp)
 
 /* do the release, watching for deleted entries, log already held */
 int
-afs_icl_LogReleNL(register struct afs_icl_log *logp)
+afs_icl_LogReleNL(struct afs_icl_log *logp)
 {
     if (--logp->refCount == 0 && (logp->states & ICL_LOGF_DELETED)) {
        afs_icl_ZapLog(logp);   /* destroys logp's lock! */
@@ -1156,7 +1004,7 @@ afs_icl_LogReleNL(register struct afs_icl_log *logp)
 
 /* zero out the log */
 int
-afs_icl_ZeroLog(register struct afs_icl_log *logp)
+afs_icl_ZeroLog(struct afs_icl_log *logp)
 {
     ObtainWriteLock(&logp->lock, 192);
     logp->firstUsed = logp->firstFree = 0;
@@ -1168,7 +1016,7 @@ afs_icl_ZeroLog(register struct afs_icl_log *logp)
 
 /* free a log entry, and drop its reference count */
 int
-afs_icl_LogFree(register struct afs_icl_log *logp)
+afs_icl_LogFree(struct afs_icl_log *logp)
 {
     ObtainWriteLock(&logp->lock, 193);
     logp->states |= ICL_LOGF_DELETED;
@@ -1181,7 +1029,7 @@ afs_icl_LogFree(register struct afs_icl_log *logp)
 struct afs_icl_log *
 afs_icl_FindLog(char *name)
 {
-    register struct afs_icl_log *tp;
+    struct afs_icl_log *tp;
     ObtainWriteLock(&afs_icl_lock, 194);
     for (tp = afs_icl_allLogs; tp; tp = tp->nextp) {
        if (strcmp(tp->name, name) == 0) {
@@ -1194,32 +1042,6 @@ afs_icl_FindLog(char *name)
     return tp;
 }
 
-int
-afs_icl_EnumerateLogs(int (*aproc)
-                       (char *name, char *arock, struct afs_icl_log * tp),
-                     char *arock)
-{
-    register struct afs_icl_log *tp;
-    register afs_int32 code;
-
-    code = 0;
-    ObtainWriteLock(&afs_icl_lock, 195);
-    for (tp = afs_icl_allLogs; tp; tp = tp->nextp) {
-       tp->refCount++;         /* hold this guy */
-       ReleaseWriteLock(&afs_icl_lock);
-       ObtainReadLock(&tp->lock);
-       code = (*aproc) (tp->name, arock, tp);
-       ReleaseReadLock(&tp->lock);
-       ObtainWriteLock(&afs_icl_lock, 196);
-       if (--tp->refCount == 0)
-           afs_icl_ZapLog(tp);
-       if (code)
-           break;
-    }
-    ReleaseWriteLock(&afs_icl_lock);
-    return code;
-}
-
 struct afs_icl_set *afs_icl_allSets = 0;
 
 int
@@ -1242,8 +1064,8 @@ afs_icl_CreateSetWithFlags(char *name, struct afs_icl_log *baseLogp,
                           struct afs_icl_log *fatalLogp, afs_uint32 flags,
                           struct afs_icl_set **outSetpp)
 {
-    register struct afs_icl_set *setp;
-    register int i;
+    struct afs_icl_set *setp;
+    int i;
     afs_int32 states = ICL_DEFAULT_SET_STATES;
 
     ObtainWriteLock(&afs_icl_lock, 197);
@@ -1272,7 +1094,7 @@ afs_icl_CreateSetWithFlags(char *name, struct afs_icl_log *baseLogp,
     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)
@@ -1289,6 +1111,7 @@ afs_icl_CreateSetWithFlags(char *name, struct afs_icl_log *baseLogp,
     strcpy(setp->name, name);
     setp->nevents = ICL_DEFAULTEVENTS;
     setp->eventFlags = afs_osi_Alloc(ICL_DEFAULTEVENTS);
+    osi_Assert(setp->eventFlags != NULL);
 #ifdef KERNEL_HAVE_PIN
     pin((char *)setp->eventFlags, ICL_DEFAULTEVENTS);
 #endif
@@ -1319,49 +1142,9 @@ afs_icl_CreateSetWithFlags(char *name, struct afs_icl_log *baseLogp,
     return 0;
 }
 
-/* function to change event enabling information for a particular set */
-int
-afs_icl_SetEnable(struct afs_icl_set *setp, afs_int32 eventID, int setValue)
-{
-    char *tp;
-
-    ObtainWriteLock(&setp->lock, 200);
-    if (!ICL_EVENTOK(setp, eventID)) {
-       ReleaseWriteLock(&setp->lock);
-       return -1;
-    }
-    tp = &setp->eventFlags[ICL_EVENTBYTE(eventID)];
-    if (setValue)
-       *tp |= ICL_EVENTMASK(eventID);
-    else
-       *tp &= ~(ICL_EVENTMASK(eventID));
-    ReleaseWriteLock(&setp->lock);
-    return 0;
-}
-
-/* return indication of whether a particular event ID is enabled
- * for tracing.  If *getValuep is set to 0, the event is disabled,
- * otherwise it is enabled.  All events start out enabled by default.
- */
-int
-afs_icl_GetEnable(struct afs_icl_set *setp, afs_int32 eventID, int *getValuep)
-{
-    ObtainReadLock(&setp->lock);
-    if (!ICL_EVENTOK(setp, eventID)) {
-       ReleaseWriteLock(&setp->lock);
-       return -1;
-    }
-    if (setp->eventFlags[ICL_EVENTBYTE(eventID)] & ICL_EVENTMASK(eventID))
-       *getValuep = 1;
-    else
-       *getValuep = 0;
-    ReleaseReadLock(&setp->lock);
-    return 0;
-}
-
 /* hold and release event sets */
 int
-afs_icl_SetHold(register struct afs_icl_set *setp)
+afs_icl_SetHold(struct afs_icl_set *setp)
 {
     ObtainWriteLock(&afs_icl_lock, 201);
     setp->refCount++;
@@ -1371,11 +1154,11 @@ afs_icl_SetHold(register struct afs_icl_set *setp)
 
 /* free a set.  Called with afs_icl_lock locked */
 int
-afs_icl_ZapSet(register struct afs_icl_set *setp)
+afs_icl_ZapSet(struct afs_icl_set *setp)
 {
-    register struct afs_icl_set **lpp, *tp;
+    struct afs_icl_set **lpp, *tp;
     int i;
-    register struct afs_icl_log *tlp;
+    struct afs_icl_log *tlp;
 
     for (lpp = &afs_icl_allSets, tp = *lpp; tp; lpp = &tp->nextp, tp = *lpp) {
        if (tp == setp) {
@@ -1399,7 +1182,7 @@ afs_icl_ZapSet(register struct afs_icl_set *setp)
 
 /* do the release, watching for deleted entries */
 int
-afs_icl_SetRele(register struct afs_icl_set *setp)
+afs_icl_SetRele(struct afs_icl_set *setp)
 {
     ObtainWriteLock(&afs_icl_lock, 202);
     if (--setp->refCount == 0 && (setp->states & ICL_SETF_DELETED)) {
@@ -1411,7 +1194,7 @@ afs_icl_SetRele(register struct afs_icl_set *setp)
 
 /* free a set entry, dropping its reference count */
 int
-afs_icl_SetFree(register struct afs_icl_set *setp)
+afs_icl_SetFree(struct afs_icl_set *setp)
 {
     ObtainWriteLock(&setp->lock, 203);
     setp->states |= ICL_SETF_DELETED;
@@ -1424,7 +1207,7 @@ afs_icl_SetFree(register struct afs_icl_set *setp)
 struct afs_icl_set *
 afs_icl_FindSet(char *name)
 {
-    register struct afs_icl_set *tp;
+    struct afs_icl_set *tp;
     ObtainWriteLock(&afs_icl_lock, 204);
     for (tp = afs_icl_allSets; tp; tp = tp->nextp) {
        if (strcmp(tp->name, name) == 0) {
@@ -1441,7 +1224,7 @@ afs_icl_FindSet(char *name)
 int
 afs_icl_ZeroSet(struct afs_icl_set *setp)
 {
-    register int i;
+    int i;
     int code = 0;
     int tcode;
     struct afs_icl_log *logp;
@@ -1462,54 +1245,6 @@ afs_icl_ZeroSet(struct afs_icl_set *setp)
 }
 
 int
-afs_icl_EnumerateSets(int (*aproc)
-                       (char *name, char *arock, struct afs_icl_log * tp),
-                     char *arock)
-{
-    register struct afs_icl_set *tp, *np;
-    register afs_int32 code;
-
-    code = 0;
-    ObtainWriteLock(&afs_icl_lock, 205);
-    for (tp = afs_icl_allSets; tp; tp = np) {
-       tp->refCount++;         /* hold this guy */
-       ReleaseWriteLock(&afs_icl_lock);
-       code = (*aproc) (tp->name, arock, (struct afs_icl_log *)tp);
-       ObtainWriteLock(&afs_icl_lock, 206);
-       np = tp->nextp;         /* tp may disappear next, but not np */
-       if (--tp->refCount == 0 && (tp->states & ICL_SETF_DELETED))
-           afs_icl_ZapSet(tp);
-       if (code)
-           break;
-    }
-    ReleaseWriteLock(&afs_icl_lock);
-    return code;
-}
-
-int
-afs_icl_AddLogToSet(struct afs_icl_set *setp, struct afs_icl_log *newlogp)
-{
-    register int i;
-    int code = -1;
-
-    ObtainWriteLock(&setp->lock, 207);
-    for (i = 0; i < ICL_LOGSPERSET; i++) {
-       if (!setp->logs[i]) {
-           setp->logs[i] = newlogp;
-           code = i;
-           afs_icl_LogHold(newlogp);
-           if (!(setp->states & ICL_SETF_FREED)) {
-               /* bump up the number of sets using the log */
-               afs_icl_LogUse(newlogp);
-           }
-           break;
-       }
-    }
-    ReleaseWriteLock(&setp->lock);
-    return code;
-}
-
-int
 afs_icl_SetSetStat(struct afs_icl_set *setp, int op)
 {
     int i;
@@ -1549,7 +1284,7 @@ afs_icl_SetSetStat(struct afs_icl_set *setp, int op)
        break;
 
     case ICL_OP_SS_FREE:       /* deassert design for log */
-       /* 
+       /*
         * if we are already in this state, do nothing; otherwise
         * deassert desire for log
         */