Remove DUX/OSF code
[openafs.git] / src / venus / kdump.c
index 71bde8a..bb80880 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
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID
-    ("$Header$");
+#include <roken.h>
 
-#include <stdio.h>
-#include <errno.h>
-#include <stdlib.h>            /* for malloc() */
+#include <afs/cmd.h>
 
+#if !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
 /* Here be hacks. */
 #ifdef AFS_LINUX24_ENV
 #define __KERNEL__
@@ -27,6 +25,16 @@ RCSID
 #undef USE_UCONTEXT
 #endif
 
+#ifdef AFS_LINUX26_ENV
+/* For some reason, this doesn't get defined in linux/types.h
+   if __KERNEL_STRICT_NAMES is defined. But the definition of
+   struct inode uses it.
+*/
+#ifndef pgoff_t
+#define pgoff_t unsigned long
+#endif
+#endif
+
 #include <string.h>
 
 #ifdef __linux__
@@ -98,10 +106,6 @@ struct ncp_sb_info {
 #define _KERNEL 1
 #endif
 
-#ifndef        AFS_OSF_ENV
-#include <sys/param.h>
-#endif
-
 #ifndef AFS_LINUX20_ENV
 #include <nlist.h>
 #endif
@@ -111,61 +115,10 @@ struct ncp_sb_info {
 #endif
 
 #include <afs/stds.h>
-#include <sys/types.h>
-
-#if defined(AFS_OSF_ENV)
-#define        KERNEL
-#define        UNIX_LOCKS
-#define        _KERNEL 1
-#ifdef _KERN_LOCK_H_
-#include FFFFF
-#endif
-#include <sys/time.h>
-#include <kern/lock.h>
-#include <sys/vnode.h>
-#include <arch/alpha/pmap.h>
-
-/*
- * beginning with DUX 4.0A, the system header files define the macros
- *
- * KSEG_TO_PHYS()
- * IS_KSEG_VA()
- * IS_SEG1_VA()
- *
- * to be calls to the kernel functions
- *
- * kseg_to_phys()
- * is_kseg_va()
- * is_seg1_va()
- * 
- * when _KERNEL is defined, and expressions otherwise.  Since need
- * to define _KERNEL, we redefine these kernel functions as macros
- * for the expressions that we would have gotten if _KERNEL had not
- * been defined.  Yes, this duplicates code from the header files, but
- * there's no simple way around it.
- */
-
-#define kseg_to_phys(addr) ((vm_offset_t)(addr) - UNITY_BASE)
-#define is_kseg_va(x)   (((unsigned long)(x) & SEG1_BASE) == UNITY_BASE)
-#define is_seg1_va(x)   (((unsigned long)(x) & SEG1_BASE) == SEG1_BASE)
-
-#undef KERNEL
-#undef  _KERNEL
-#endif
 
 #ifdef AFS_SUN5_ENV /*XXXXX*/
 #include <sys/t_lock.h>
 struct vnode foo;
-#ifdef AFS_SUN54_ENV
-#else
-#ifdef AFS_SUN52_ENV
-typedef struct stat_mutex stat_mutex_t;
-#define        kmutex_t                stat_mutex_t
-#else
-typedef struct adaptive_mutex2 adaptive_mutex2_t;
-#define        kmutex_t        adaptive_mutex2_t
-#endif
-#endif
 #endif
 
 #ifdef AFS_SGI53_ENV
@@ -176,8 +129,6 @@ typedef struct adaptive_mutex2 adaptive_mutex2_t;
 #endif
 #endif
 
-#include <sys/file.h>
-
 #ifdef AFS_SGI62_ENV
 #include <sys/fcntl.h>
 #ifndef L_SET
@@ -191,8 +142,8 @@ typedef struct adaptive_mutex2 adaptive_mutex2_t;
 #include <sys/user.h>
 #endif
 
-#ifndef AFS_LINUX20_ENV
-#include <sys/socket.h>
+#ifndef AFS_LINUX26_ENV
+#include <sys/file.h>
 #endif
 
 /*
@@ -213,18 +164,11 @@ typedef struct adaptive_mutex2 adaptive_mutex2_t;
 # include <netinet/in.h>       /* struct in_addr */
 #endif
 
-#include <arpa/inet.h>         /* inet_ntoa() */
-
-#if defined(AFS_SGI_ENV) || defined(AFS_OSF_ENV)
+#if defined(AFS_SGI_ENV)
 #ifdef       AFS_SGI_ENV
 #include <sys/vnode.h>
 #endif /* AFS_SGI_ENV */
 #else
-#ifdef       AFS_MACH_ENV
-#include <vfs/vfs.h>
-#include <vfs/vnode.h>
-#include <sys/inode.h>
-#else /* AFS_MACH_ENV */
 #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
 #include <sys/vnode.h>
 #include <sys/mount.h>
@@ -234,7 +178,9 @@ typedef struct adaptive_mutex2 adaptive_mutex2_t;
 #else
 #include "sys/vfs.h"
 #ifdef AFS_LINUX20_ENV
+#ifndef UIO_MAXIOV
 #define UIO_MAXIOV 1           /* don't care */
+#endif
 #if __GLIBC_MINOR__ == 0
 #include <iovec.h>
 #endif
@@ -246,7 +192,12 @@ typedef struct adaptive_mutex2 adaptive_mutex2_t;
 #undef LONG_MAX
 #undef ULONG_MAX
 #define _LINUX_TIME_H
+#ifndef AFS_LINUX26_ENV
 #define _LINUX_FCNTL_H
+#endif
+#ifdef AFS_IA64_LINUX24_ENV
+#define flock64  flock
+#endif /* AFS_IA64_LINUX24_ENV */
 #ifdef AFS_S390_LINUX20_ENV
 #define _S390_STATFS_H
 #else
@@ -274,7 +225,7 @@ typedef struct timeval {
     int tv_usec;
 } timeval_t;                   /* Needed here since KERNEL defined. */
 #endif /*AFS_ALPHA_LINUX20_ENV */
-#if defined(AFSBIG_ENDIAN)
+#if defined(WORDS_BIGENDIAN)
 #define _LINUX_BYTEORDER_BIG_ENDIAN_H
 #else
 #define _LINUX_BYTEORDER_LITTLE_ENDIAN_H
@@ -284,6 +235,16 @@ typedef struct timeval {
 #define timer_t ktimer_t
 #define timer_t_redefined
 #endif
+#ifdef AFS_LINUX26_ENV
+/* For some reason, this doesn't get defined in linux/types.h
+   if __KERNEL_STRICT_NAMES is defined. But the definition of
+   struct inode uses it.
+*/
+#ifndef HAVE_SECTOR_T
+/* got it from linux/types.h */
+typedef unsigned long sector_t;
+#endif /* HAVE_SECTOR_T */
+#endif /* AFS_LINUX26_ENV */
 #include <linux/version.h>
 #include <linux/fs.h>
 #include <osi_vfs.h>
@@ -327,8 +288,6 @@ typedef enum _spustate {    /* FROM /etc/conf/h/_types.h */
 #endif
 #endif
 #endif
-#endif /* AFS_MACH_ENV */
-#include <signal.h>
 #endif
 
 /* AFS includes */
@@ -357,15 +316,6 @@ typedef kmutex_t afs_kmutex_t;
 typedef kcondvar_t afs_kcondvar_t;
 #endif /* AFS_SUN5_ENV */
 
-#ifdef AFS_DUX40_ENV
-#define RX_ENABLE_LOCKS
-typedef struct {
-    unsigned long lock;
-    void *owner;
-} afs_kmutex_t;
-typedef int afs_kcondvar_t;
-#endif /* AFS_DUX40_ENV */
-
 #ifdef AFS_HPUX110_ENV
 #define RX_ENABLE_LOCKS
 typedef struct {
@@ -451,15 +401,6 @@ extern off64_t lseek64();
 
 #undef KERNEL
 
-#if defined(AFS_OSF_ENV) && !defined(v_count)
-#define v_count         v_usecount
-#endif
-
-#ifdef AFS_OSF_ENV
-#define        KERNELBASE      0x80000000
-#define        coreadj(x)      ((int)x - KERNELBASE)
-#endif
-
 #if defined(AFS_SGI_ENV)
 #define UNIX "/unix"
 #else
@@ -533,9 +474,6 @@ void print_cmstats();
 
 
 
-#ifndef AFS_KDUMP_LIB
-extern struct cmd_syndesc *cmd_CreateSyntax();
-#endif
 int opencore();
 
 #if    defined(AFS_HPUX_ENV) && defined(__LP64__)
@@ -585,9 +523,6 @@ int Dgcpags = 0;
 #include <sys/elf.h>
 #include <libelf.h>
 #include <sys/elf_M32.h>
-#ifndef        AFS_SUN54_ENV
-typedef ulong_t k_fltset_t;    /* XXXXXXXXXXX */
-#endif /* !AFS_SUN54_ENV */
 #include <sys/proc.h>
 #include <sys/file.h>
 #define        _NLIST_H                /* XXXXXXXXXXXXX */
@@ -621,11 +556,12 @@ PrintIPAddr(int addr)
 
 #ifdef AFS_LINUX20_ENV
 /* Find symbols in a live kernel. */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 
+#ifdef AFS_LINUX26_ENV
+#define KSYMS "/proc/kallsyms"
+#else
 #define KSYMS "/proc/ksyms"
+#endif
 
 /* symlist_t contains all the kernel symbols. Forcing a 64 byte array is
  * a bit wasteful, but simple.
@@ -633,7 +569,11 @@ PrintIPAddr(int addr)
 #define MAXNAMELEN 64
 typedef struct symlist {
     char s_name[MAXNAMELEN];
+#ifdef AFS_LINUX_64BIT_KERNEL
+    unsigned long s_value;
+#else
     int s_value;
+#endif /* AFS_LINUX_64BIT_KERNEL */
 } symlist_t;
 
 #define KSYM_ALLOC_STEP 128
@@ -670,7 +610,7 @@ read_ksyms(void)
     }
 
     availksyms = KSYM_ALLOC_BASE;
-    ksyms = (symlist_t *) malloc(availksyms * sizeof(symlist_t));
+    ksyms = malloc(availksyms * sizeof(symlist_t));
     if (!ksyms) {
        printf("Can't malloc %d elements for symbol list.\n", availksyms);
        exit(1);
@@ -680,15 +620,25 @@ read_ksyms(void)
     while (fgets(line, MAXLINE, fp)) {
        if (nksyms >= availksyms) {
            availksyms += KSYM_ALLOC_STEP;
-           ksyms =
-               (symlist_t *) realloc(ksyms, availksyms * sizeof(symlist_t));
+           ksyms = realloc(ksyms, availksyms * sizeof(symlist_t));
            if (!ksyms) {
                printf("Failed to realloc %d symbols.\n", availksyms);
                exit(1);
            }
        }
+#ifdef AFS_LINUX_64BIT_KERNEL
+       ksyms[nksyms].s_value = (unsigned long)strtoul(line, &p, 16);
+#else
        ksyms[nksyms].s_value = (int)strtoul(line, &p, 16);
+#endif /* AFS_LINUX_64BIT_KERNEL */
        p++;
+#ifdef AFS_LINUX26_ENV
+       /* Linux 2.6 /proc/kallsyms has a one-char symbol type
+          between address and name, so step over it and the following
+          blank.
+       */
+       p += 2;
+#endif
        q = strchr(p, '\t');
        if (q)
            *q = '\0';
@@ -707,7 +657,11 @@ read_ksyms(void)
 
 
 /* find_symbol returns 0 if not found, otherwise value for symbol */
+#ifdef AFS_LINUX_64BIT_KERNEL
+unsigned long
+#else
 int
+#endif /* AFS_LINUX_64BIT_KERNEL */
 find_symbol(char *name)
 {
     symlist_t *tmp;
@@ -780,15 +734,15 @@ symsrch(s)
 
 #endif /*defined(AFS_SUN5_ENV) */
 
+#endif /*!defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV) */
 
 #ifndef AFS_KDUMP_LIB
-static
-cmdproc(as, arock)
-     register struct cmd_syndesc *as;
-     afs_int32 arock;
+static int
+cmdproc(struct cmd_syndesc *as, void *arock)
 {
-    register afs_int32 code = 0;
+    afs_int32 code = 0;
 
+#if !defined(AFS_DARWIN_ENV) && !defined(AFS_FBSD_ENV)
     if (as->parms[0].items) {  /* -kobj */
        obj = as->parms[0].items->data;
     }
@@ -888,6 +842,7 @@ cmdproc(as, arock)
     if (as->parms[31].items) { /* -dhash */
        DdvnextTbl = 1, DdcnextTbl = 1, Dall = 0;
     }
+#endif
 
     code = kdump();
     return code;
@@ -895,12 +850,11 @@ cmdproc(as, arock)
 
 #include "AFS_component_version_number.c"
 
-main(argc, argv)
-     int argc;
-     char **argv;
+int
+main(int argc, char **argv)
 {
-    register struct cmd_syndesc *ts;
-    register afs_int32 code;
+    struct cmd_syndesc *ts;
+    afs_int32 code;
 
 #ifdef AFS_AIX32_ENV
     struct sigaction nsa;
@@ -911,7 +865,7 @@ main(argc, argv)
     sigaction(SIGSEGV, &nsa, NULL);
 #endif
 
-    ts = cmd_CreateSyntax(NULL, cmdproc, 0,
+    ts = cmd_CreateSyntax(NULL, cmdproc, NULL, 0,
                          "Read internal cache manager structs");
     cmd_AddParm(ts, "-kobj", CMD_SINGLE, CMD_OPTIONAL,
                "kernel object (default /vmunix)");
@@ -974,11 +928,10 @@ main(argc, argv)
 
 #ifdef AFS_AIX_ENV
 #ifndef AFS_KDUMP_LIB
-Knlist(sp, cnt, size)
-     struct afs_nlist *sp;
-     int cnt, size;
+int
+Knlist(struct afs_nlist *sp, int cnt, int size)
 {
-    register int code;
+    int code;
 
     if (UserLevel)
        code = nlist(obj, sp);
@@ -1033,15 +986,6 @@ findsym(char *sname, off_t * offset)
                    errno, strerror(errno));
            exit(1);
        }
-#if    defined(AFS_OSF_ENV)
-       if (mem) {
-           long X;
-
-           X = coreadj(request[0].n_value);
-           request[0].n_value = X;
-       }
-#endif /* defined(AFS_OSF_ENV) */
-
        *offset = request[0].n_value;
        if (!request[0].n_value) {
            printf("(WARNING) Couldn't find %s in %s. Proceeding..\n", sname,
@@ -1056,12 +1000,13 @@ findsym(char *sname, off_t * offset)
 
 #define CBHTSIZE 128
 
-kdump()
+int
+kdump(void)
 {
-    int cell, cnt, cnt1;
 #if defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV)
     printf("Kdump not supported\n");
 #else
+    int cell, cnt, cnt1;
 #ifndef AFS_KDUMP_LIB
 
     kmem = opencore(core);
@@ -1206,8 +1151,7 @@ int Sum_vcachemvids = 0, Sum_vcachelinkData = 0, Sum_vcacheacc =
 int Sum_cellaliases = 0, Sum_cellname_names = 0;
 
 int
-print_cells(pnt)
-     int pnt;
+print_cells(int pnt)
 {
     off_t symoff;
     struct cell *cells, cle, *clentry = &cle, *clep;
@@ -1298,8 +1242,7 @@ print_cellnames(int pnt)
 }
 
 int
-print_users(pnt)
-     int pnt;
+print_users(int pnt)
 {
     off_t symoff;
     struct unixuser *afs_users[NUSERS], ue, *uentry = &ue, *uep;
@@ -1325,8 +1268,7 @@ afs_int32 NserversFound = 0;
 #define SF_ALLOCATION_STEP 500
 
 int
-add_found_server(sep)
-     struct server *sep;
+add_found_server(struct server *sep)
 {
     static afs_int32 NserversAllocated = 0;
     static afs_int32 failed = 0;
@@ -1337,14 +1279,12 @@ add_found_server(sep)
     if (NserversFound >= NserversAllocated) {
        NserversAllocated += SF_ALLOCATION_STEP;
        if (!serversFound) {
-           serversFound =
-               (struct server **)malloc(NserversAllocated *
-                                        sizeof(struct server *));
+           serversFound = malloc(NserversAllocated *
+                                 sizeof(struct server *));
        } else {
-           serversFound =
-               (struct server **)realloc((char *)serversFound,
-                                         NserversAllocated *
-                                         sizeof(struct server *));
+           serversFound = realloc(serversFound,
+                                  NserversAllocated *
+                                  sizeof(struct server *));
        }
        if (!serversFound) {
            printf("Can't allocate %lu bytes for list of found servers.\n",
@@ -1359,8 +1299,7 @@ add_found_server(sep)
 }
 
 int
-find_server(sep)
-     struct server *sep;
+find_server(struct server *sep)
 {
     int i;
 
@@ -1372,8 +1311,7 @@ find_server(sep)
 }
 
 int
-print_servers(pnt)
-     int pnt;
+print_servers(int pnt)
 {
     off_t symoff;
     struct server *afs_servers[NSERVERS], se, *sentry = &se, *sep;
@@ -1384,7 +1322,7 @@ print_servers(pnt)
     int chainCount[NSERVERS];
 
     if (pnt) {
-       memset((char *)chainCount, 0, sizeof(chainCount));
+       memset(chainCount, 0, sizeof(chainCount));
        printf("\n\nPrinting 'afs_servers' structures...\n");
     }
     findsym("afs_servers", &symoff);
@@ -1422,7 +1360,7 @@ print_servers(pnt)
 
     /* Verify against afs_totalServers. */
     if (pnt) {
-       memset((char *)chainCount, 0, sizeof(chainCount));
+       memset(chainCount, 0, sizeof(chainCount));
        if (findsym("afs_totalServers", &symoff)) {
            kread(kmem, symoff, (char *)&afs_totalServers, sizeof(afs_int32));
            if (afs_totalServers != nServers) {
@@ -1497,8 +1435,7 @@ print_servers(pnt)
 
 
 void
-print_Conns(pnt)
-     int pnt;
+print_Conns(int pnt)
 {
     off_t symoff;
     struct server *afs_servers[NSERVERS], se, *sentry = &se, *sep;
@@ -1520,8 +1457,7 @@ print_Conns(pnt)
 
 
 int
-print_volumes(pnt)
-     int pnt;
+print_volumes(int pnt)
 {
     off_t symoff;
     struct volume *afs_volumes[NVOLS], ve, *ventry = &ve, *vep;
@@ -1543,8 +1479,7 @@ print_volumes(pnt)
 }
 
 void
-print_cbHash(pnt)
-     int pnt;
+print_cbHash(int pnt)
 {
     off_t symoff;
     struct afs_q cbHashT[CBHTSIZE];
@@ -1564,8 +1499,7 @@ print_cbHash(pnt)
 }
 
 int
-print_vcaches(pnt)
-     int pnt;
+print_vcaches(int pnt)
 {
     off_t symoff;
     struct vcache *afs_vhashTable[VCSIZE], Ve, *Ventry = &Ve, *Vep;
@@ -1595,8 +1529,7 @@ print_vcaches(pnt)
 }
 
 int
-print_dcaches(pnt)
-     int pnt;
+print_dcaches(int pnt)
 {
     off_t symoff;
     long table, *ptr;
@@ -1611,7 +1544,7 @@ print_dcaches(pnt)
     kread(kmem, symoff, (char *)&count, sizeof count);
     findsym("afs_indexTable", &symoff);
     kread(kmem, symoff, (char *)&table, sizeof(long));
-    ptr = (long *)malloc(count * sizeof(long));
+    ptr = malloc(count * sizeof(long));
     kread(kmem, table, (char *)ptr, count * sizeof(long));
     for (i = 0, j = 0; i < count; i++) {
        if (dp = (struct dcache *)ptr[i]) {
@@ -1635,8 +1568,7 @@ print_dcaches(pnt)
 
 
 void
-print_DindexTimes(pnt)
-     int pnt;
+print_DindexTimes(int pnt)
 {
     off_t symoff;
     long table;
@@ -1651,7 +1583,7 @@ print_DindexTimes(pnt)
     kread(kmem, symoff, (char *)&count, sizeof count);
     findsym("afs_indexTimes", &symoff);
     kread(kmem, symoff, (char *)&table, sizeof(long));
-    ptr = (afs_hyper_t *) malloc(count * sizeof(afs_hyper_t));
+    ptr = malloc(count * sizeof(afs_hyper_t));
     kread(kmem, table, (char *)ptr, count * sizeof(afs_hyper_t));
     for (i = 0, j = 0; i < count; i++) {
        if (pnt)
@@ -1672,8 +1604,7 @@ print_DindexTimes(pnt)
 
 
 void
-print_DdvnextTbl(pnt)
-     int pnt;
+print_DdvnextTbl(int pnt)
 {
     off_t symoff;
     long table;
@@ -1688,7 +1619,7 @@ print_DdvnextTbl(pnt)
     kread(kmem, symoff, (char *)&count, sizeof count);
     findsym("afs_dvnextTbl", &symoff);
     kread(kmem, symoff, (char *)&table, sizeof(long));
-    ptr = (afs_int32 *) malloc(count * sizeof(afs_int32));
+    ptr = malloc(count * sizeof(afs_int32));
     kread(kmem, table, (char *)ptr, count * sizeof(afs_int32));
     for (i = 0, j = 0; i < count; i++) {
        if (pnt)
@@ -1702,8 +1633,7 @@ print_DdvnextTbl(pnt)
 
 
 void
-print_DdcnextTbl(pnt)
-     int pnt;
+print_DdcnextTbl(int pnt)
 {
     off_t symoff;
     long table;
@@ -1718,7 +1648,7 @@ print_DdcnextTbl(pnt)
     kread(kmem, symoff, (char *)&count, sizeof count);
     findsym("afs_dcnextTbl", &symoff);
     kread(kmem, symoff, (char *)&table, sizeof(long));
-    ptr = (afs_int32 *) malloc(count * sizeof(afs_int32));
+    ptr = malloc(count * sizeof(afs_int32));
     kread(kmem, table, (char *)ptr, count * sizeof(afs_int32));
     for (i = 0, j = 0; i < count; i++) {
        if (pnt)
@@ -1732,8 +1662,7 @@ print_DdcnextTbl(pnt)
 
 
 void
-print_DindexFlags(pnt)
-     int pnt;
+print_DindexFlags(int pnt)
 {
     off_t symoff;
     afs_int32 count;
@@ -1749,7 +1678,7 @@ print_DindexFlags(pnt)
     kread(kmem, symoff, (char *)&count, sizeof count);
     findsym("afs_indexFlags", &symoff);
     kread(kmem, symoff, (char *)&table, sizeof(long));
-    flags = (unsigned char *)malloc(count * sizeof(char));
+    flags = malloc(count * sizeof(char));
     kread(kmem, table, flags, count * sizeof(char));
     for (i = 0, j = 0; i < count; i++) {
        if (pnt)
@@ -1763,8 +1692,7 @@ print_DindexFlags(pnt)
 
 
 void
-print_buffers(pnt)
-     int pnt;
+print_buffers(int pnt)
 {
     off_t symoff;
     long table;
@@ -1779,7 +1707,7 @@ print_buffers(pnt)
     kread(kmem, symoff, (char *)&table, sizeof(long));
     findsym("nbuffers", &symoff);
     kread(kmem, symoff, (char *)&count, sizeof(int));
-    buffers = (unsigned char *)malloc(count * sizeof(struct buffer));
+    buffers = malloc(count * sizeof(struct buffer));
     kread(kmem, table, buffers, count * sizeof(struct buffer));
     bp = (struct buffer *)buffers;
     for (i = 0, j = 0; i < count; i++, bp++) {
@@ -1793,7 +1721,7 @@ print_buffers(pnt)
        if (pnt)
            printf
                ("Buffer #%d:\tfid=%lu page=%d, accTime=%d,\n\tHash=%x, data=%x, lockers=%x, dirty=%d, hashI=%d\n",
-                i, bp->fid[0], bp->page, bp->accesstime, bp->hashNext,
+                i, bp->fid, bp->page, bp->accesstime, bp->hashNext,
                 bp->data, bp->lockers, bp->dirty, bp->hashIndex);
 #endif
        j++;
@@ -1804,8 +1732,7 @@ print_buffers(pnt)
 
 
 int
-print_nfss(pnt)
-     int pnt;
+print_nfss(int pnt)
 {
     off_t symoff;
     struct afs_exporter *exp_entry, ex, *exp = &ex, *exp1;
@@ -1885,7 +1812,11 @@ print_alloced_memlist(void)
     findsym("afs_linux_memlist", &symoff);
     kread(kmem, symoff, (char *)&memp, sizeof memp);
     if (memp) {
+#ifdef AFS_LINUX_64BIT_KERNEL
+       kread(kmem, (unsigned long)memp, (char *)&next, sizeof next);
+#else
        kread(kmem, (int)memp, (char *)&next, sizeof next);
+#endif /* AFS_LINUX_64BIT_KERNEL */
     } else {
        memset(&next, 0, sizeof next);
     }
@@ -1907,8 +1838,7 @@ print_alloced_memlist(void)
 #endif
 
 void
-print_allocs(pnt)
-     int pnt;
+print_allocs(int pnt)
 {
     off_t symoff;
     long count, i, j, k, l, m, n, T = 0, tvs;
@@ -1960,10 +1890,10 @@ print_allocs(pnt)
     T += j;
     printf("%20s:\t%8d bytes\t[%d servers/%d bytes each]\n", "Server package",
           j, i, sizeof(struct server));
-    j = (Nconns * sizeof(struct conn));
+    j = (Nconns * sizeof(struct afs_conn));
     T += j;
     printf("%20s:\t%8d bytes\t[%d conns/%d bytes each]\n",
-          "Connection package", j, Nconns, sizeof(struct conn));
+          "Connection package", j, Nconns, sizeof(struct afs_conn));
 
     i = (AFS_NCBRS * sizeof(struct afs_cbr)) * (j =
                                                afs_cmperfstats.
@@ -2072,13 +2002,11 @@ print_allocs(pnt)
     T += i;
     printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n", "Buffer package",
           i, j, sizeof(struct buffer));
-#if    !AFS_USEBUFFERS
 #define        AFS_BUFFER_PAGESIZE 2048
     i = j * AFS_BUFFER_PAGESIZE;
     T += i;
     printf("%20s:\t%8d bytes\t[%d entries/%d bytes each]\n",
           "Xtra Buffer pkg area", i, j, AFS_BUFFER_PAGESIZE);
-#endif
 
     Sum_exps = 0;
     Sum_nfssysnames = 0;
@@ -2188,11 +2116,11 @@ print_allocs(pnt)
 int
 readmem(kmem, buf, vad, len)
      int kmem, len;
-#ifdef AFS_SUN57_ENV
+#ifdef AFS_SUN5_ENV
      uintptr_t vad;
 #else
      int vad;
-#endif         /** AFS_SUN57_ENV **/
+#endif         /** AFS_SUN5_ENV **/
      char *buf;
 {
     int newlen;
@@ -2203,79 +2131,6 @@ readmem(kmem, buf, vad, len)
 }
 #endif
 
-#ifdef AFS_OSF_ENV
-static
-read_addr(int fd, unsigned long addr, unsigned long *val)
-{
-    if (lseek(fd, addr, SEEK_SET) == -1)
-       return (0);
-    if (read(fd, val, sizeof(long)) != sizeof(long))
-       return (0);
-    return (1);
-}
-
-static pt_entry_t *ptes = NULL;
-static
-addr_to_offset(unsigned long addr, unsigned long *ret, int fd)
-{
-    off_t symoff;
-    pt_entry_t pte, *val;
-    char *str, *ptr;
-
-    if (IS_SEG1_VA(addr)) {
-       if (ptes == NULL) {
-           int i, loc;
-           unsigned long loc1, loc2[2];
-           findsym("kernel_pmap", &symoff);
-           loc1 = coreadj(symoff);
-           /*printf("ptes=%lx -> %lx\n", symoff, loc1); */
-           if (lseek(fd, loc1, L_SET /*0 */ ) != loc1) {
-               perror("lseek");
-               exit(1);
-           }
-           if ((i = read(fd, (char *)&loc1, sizeof(long))) != sizeof(long)) {
-               printf("Read of kerne_map failed\n");
-               return;         /*exit(1); */
-           }
-           loc = loc1;
-           /*printf("loc1 %lx -> %lx\n",  loc1, loc); */
-           if (lseek(fd, loc, L_SET /*0 */ ) != loc) {
-               perror("lseek");
-               exit(1);
-           }
-           if ((i =
-                read(fd, (char *)loc2,
-                     2 * sizeof(long))) != 2 * sizeof(long)) {
-               printf("Read of kerne_map failed\n");
-               return;         /*exit(1); */
-           }
-           ptes = (pt_entry_t *) loc2[1];
-           /*printf("ptes=%lx\n", ptes); */
-
-       }
-       if (!addr_to_offset
-           ((unsigned long)(ptes + LEVEL1_PT_OFFSET(addr)),
-            (unsigned long *)&val, fd))
-           return (0);
-       if (!read_addr(fd, (unsigned long)val, (unsigned long *)&pte))
-           return (0);
-       val = ((pt_entry_t *) PTETOPHYS(&pte)) + LEVEL2_PT_OFFSET(addr);
-       if (!read_addr(fd, (unsigned long)val, (unsigned long *)&pte))
-           return (0);
-       val = ((pt_entry_t *) PTETOPHYS(&pte)) + LEVEL3_PT_OFFSET(addr);
-       if (!read_addr(fd, (unsigned long)val, (unsigned long *)&pte))
-           return (0);
-       *ret = PTETOPHYS(&pte) + (addr & ((1 << PGSHIFT) - 1));
-       return (1);
-    } else if (IS_KSEG_VA(addr)) {
-       *ret = KSEG_TO_PHYS(addr);
-       return (1);
-    } else {
-       return (0);
-    }
-}
-#endif
-
 #ifndef AFS_KDUMP_LIB
 void
 kread(int kmem, off_t loc, void *buf, KDUMP_SIZE_T len)
@@ -2284,19 +2139,6 @@ kread(int kmem, off_t loc, void *buf, KDUMP_SIZE_T len)
 
     memset(buf, 0, len);
 
-#ifdef AFS_OSF_ENV
-    if (mem) {
-       unsigned long ret;
-       i = addr_to_offset(loc, &ret, kmem);
-       if (i == 1)
-           loc = ret;
-       else {
-           unsigned long loc1;
-           loc1 = coreadj(loc);
-           loc = loc1;
-       }
-    }
-#else
 #if    defined(sparc) && !defined(__linux__)
 #ifndef AFS_SUN5_ENV
     if (mem) {
@@ -2307,7 +2149,6 @@ kread(int kmem, off_t loc, void *buf, KDUMP_SIZE_T len)
     }
 #endif
 #endif
-#endif
 #if    ! defined(AFS_SUN5_ENV)
 #if defined(AFS_SGI61_ENV) && !defined(AFS_32BIT_KERNEL_ENV)
     if (lseek64(kmem, loc, L_SET /*0 */ ) != loc)
@@ -2318,8 +2159,8 @@ kread(int kmem, off_t loc, void *buf, KDUMP_SIZE_T len)
        perror("lseek");
        exit(1);
     }
-    if (loc == 0) 
-       printf("WARNING: Read failed: loc=0\n"); 
+    if (loc == 0)
+       printf("WARNING: Read failed: loc=0\n");
     else
        if ((i = read(kmem, buf, len)) != len) {
            printf("WARNING: Read failed: ");
@@ -2344,7 +2185,8 @@ kread(int kmem, off_t loc, void *buf, KDUMP_SIZE_T len)
   * the macro RDSYMBOLS
   */
 
-rdsymbols()
+void
+rdsymbols(void)
 {
 
     FILE *fp;
@@ -2407,8 +2249,7 @@ rdsymbols()
 
 
 int
-opencore(core)
-     char *core;
+opencore(char *core)
 {
 #ifdef AFS_KDUMP_LIB
     return 0;
@@ -2444,9 +2285,8 @@ opencore(core)
 
 
 void
-print_exporter(kmem, exporter, ptr, pnt)
-     int kmem, pnt;
-     struct afs_exporter *exporter, *ptr;
+print_exporter(int kmem, struct afs_exporter *exporter,
+              struct afs_exporter *ptr, int pnt)
 {
     if (pnt) {
        printf("\tstates=%x, type=%x, *data=%lx\n", exporter->exp_states,
@@ -2460,43 +2300,37 @@ print_exporter(kmem, exporter, ptr, pnt)
 
 
 void
-print_nfsclient(kmem, ep, ptr, pnt)
-     int kmem, pnt;
-     struct nfsclientpag *ep, *ptr;
+print_nfsclient(int kmem, struct nfsclientpag *ep,
+               struct nfsclientpag *ptr, int pnt)
 {
     char sysname[100];
+       int count;
 
-    if (ep->sysname) {
-       kread(kmem, (off_t) ep->sysname, sysname, (KDUMP_SIZE_T) 30);
-       Sum_nfssysnames += MAXSYSNAME;
-    }
     if (pnt)
-       printf("%lx: uid=%d, host=%x, pag=%x, @sys=%s, lastt=%d, ref=%d\n",
+       printf("%lx: uid=%d, host=%x, pag=%x, lastt=%d, ref=%d count=%d\n",
               ptr, ep->uid, ep->host, ep->pag,
-              (ep->sysname ? sysname : "nil"), ep->lastcall, ep->refCount);
+              ep->lastcall, ep->refCount, ep->sysnamecount);
+
+       for(count = 0; count < ep->sysnamecount; count++){
+               kread(kmem, (off_t) ep->sysname[count], sysname, (KDUMP_SIZE_T) 30);
+               printf("   %lx: @sys[%d]=%s\n",
+                       ep->sysname[count], count, sysname);
+               Sum_nfssysnames += MAXSYSNAME;
+       }
 }
 
 
 #if    defined(AFS_SUN5_ENV)
-pmutex(sp, mp)
-     char *sp;
-     kmutex_t *mp;
+void
+pmutex(char *sp, kmutex_t *mp)
 {
-#ifdef AFS_SUN54_ENV
-
-#else
-    struct stat_mutex *smp = (struct stat_mutex *)mp;
-
-    printf("%s mutex: %x %x\n", sp, smp->m_stats_lock, smp->m_type);
-#endif
 }
 
 #endif
 
 void
-print_unixuser(kmem, uep, ptr, pnt)
-     int kmem, pnt;
-     struct unixuser *uep, *ptr;
+print_unixuser(int kmem, struct unixuser *uep,
+              struct unixuser *ptr, int pnt)
 {
     Sum_userstp += uep->stLen;
     if (pnt) {
@@ -2516,9 +2350,7 @@ print_unixuser(kmem, uep, ptr, pnt)
 }
 
 void
-print_cell(kmem, clep, ptr, pnt)
-     int kmem, pnt;
-     struct cell *clep, *ptr;
+print_cell(int kmem, struct cell *clep, struct cell *ptr, int pnt)
 {
     int i;
     char cellName[100];
@@ -2538,7 +2370,7 @@ print_cell(kmem, clep, ptr, pnt)
            printf("\tlinked cellp %lx\n", clep->lcellp);
 #endif
        printf("\tCell's servers: ");
-       for (i = 0; i < MAXCELLHOSTS; i++) {
+       for (i = 0; i < AFS_MAXCELLHOSTS; i++) {
            if (pretty && (clep->cellHosts[i] == 0))
                break;
            printf("[%lx] ", clep->cellHosts[i]);
@@ -2549,9 +2381,8 @@ print_cell(kmem, clep, ptr, pnt)
 
 
 void
-print_server(kmem, sep, ptr, conns, pnt)
-     int kmem, conns, pnt;
-     struct server *sep, *ptr;
+print_server(int kmem, struct server *sep, struct server *ptr, int conns,
+            int pnt)
 {
     struct srvAddr sa, *sap = &sa, *sap1;
     int j, mh = 0, cnt;
@@ -2617,15 +2448,13 @@ print_server(kmem, sep, ptr, conns, pnt)
 
 
 void
-print_conns(kmem, srv, conns, Con, pnt)
-     int kmem, Con, pnt;
-     struct srvAddr *srv;
-     struct conn *conns;
+print_conns(int kmem, struct srvAddr *srv, struct afs_conn *conns, int Con,
+           int pnt)
 {
-    struct conn *cep, ce, *centry = &ce;
+    struct afs_conn *cep, ce, *centry = &ce;
     int i = 1;
 
-    cep = (struct conn *)conns;
+    cep = (struct afs_conn *)conns;
     if (pnt && Con != 2) {
        if (cep)
            printf("\tRPC connections for server %lx:\n", srv);
@@ -2642,9 +2471,7 @@ print_conns(kmem, srv, conns, Con, pnt)
 
 
 void
-print_conn(kmem, conns, ptr, pnt)
-     int kmem, pnt;
-     struct conn *conns, *ptr;
+print_conn(int kmem, struct afs_conn *conns, struct afs_conn *ptr, int pnt)
 {
     if (!pnt)
        return;
@@ -2656,9 +2483,7 @@ print_conn(kmem, conns, ptr, pnt)
 
 
 void
-print_volume(kmem, vep, ptr, pnt)
-     int kmem, pnt;
-     struct volume *vep, *ptr;
+print_volume(int kmem, struct volume *vep, struct volume *ptr, int pnt)
 {
     int i;
     afs_int32 *loc;
@@ -2678,22 +2503,22 @@ print_volume(kmem, vep, ptr, pnt)
           vep->backVol);
 #ifdef AFS33
     printf
-       ("\trwVol=%d, AcTime=%d, copyDate=%d, expTime=%d, vtix=%d, refC=%d, states=%x\n",
-        vep->rwVol, vep->accessTime, vep->copyDate, vep->expireTime,
+       ("\trwVol=%d, setupTime=%d, copyDate=%d, expTime=%d, vtix=%d, refC=%d, states=%x\n",
+        vep->rwVol, vep->setupTime, vep->copyDate, vep->expireTime,
         vep->vtix, vep->refCount, vep->states);
 #else
     printf
-       ("\trwVol=%d, AcTime=%d, copyDate=%d, vtix=%d, refC=%d, states=%x\n",
-        vep->rwVol, vep->accessTime, vep->copyDate, vep->vtix, vep->refCount,
+       ("\trwVol=%d, setupTime=%d, copyDate=%d, vtix=%d, refC=%d, states=%x\n",
+        vep->rwVol, vep->setupTime, vep->copyDate, vep->vtix, vep->refCount,
         vep->states);
 #endif
     printf("\tVolume's statuses: ");
-    for (i = 0; i < MAXHOSTS && vep->serverHost[i]; i++)
+    for (i = 0; i < AFS_MAXHOSTS && vep->serverHost[i]; i++)
        printf("[%d] ", vep->status[i]);
     printf("\n");
 
     printf("\tVolume's servers: ");
-    for (i = 0; i < MAXHOSTS && vep->serverHost[i]; i++)
+    for (i = 0; i < AFS_MAXHOSTS && vep->serverHost[i]; i++)
        printf("[%lx] ", vep->serverHost[i]);
     printf("\n");
 
@@ -2713,9 +2538,7 @@ print_volume(kmem, vep, ptr, pnt)
 
 
 void
-print_venusfid(string, vid)
-     char *string;
-     struct VenusFid *vid;
+print_venusfid(char *string, struct VenusFid *vid)
 {
     printf("%s(c=%x, v=%d, n=%d, u=%d)", string, vid->Cell, vid->Fid.Volume,
           vid->Fid.Vnode, vid->Fid.Unique);
@@ -2723,9 +2546,7 @@ print_venusfid(string, vid)
 
 
 void
-print_vnode(kmem, vep, ptr, pnt)
-     int kmem, pnt;
-     struct vnode *vep, *ptr;
+print_vnode(int kmem, struct vnode *vep, struct vnode *ptr, int pnt)
 {
 #ifdef AFS_AIX_ENV
     struct gnode gnode;
@@ -2779,8 +2600,13 @@ print_vnode(kmem, vep, ptr, pnt)
         vep->i_atime, vep->i_mtime, vep->i_ctime, vep->i_version,
         vep->i_nrpages);
 #endif
+#ifdef AFS_LINUX26_ENV
+    printf("\ti_op=0x%x, i_rdev=0x%x, i_sb=0x%x\n", vep->i_op,
+          vep->i_rdev, vep->i_sb);
+#else /* AFS_LINUX26_ENV */
     printf("\ti_op=0x%x, i_dev=0x%x, i_rdev=0x%x, i_sb=0x%x\n", vep->i_op,
           vep->i_dev, vep->i_rdev, vep->i_sb);
+#endif /* AFS_LINUX26_ENV */
 #ifdef AFS_LINUX24_ENV
 #ifdef AFS_PARISC_LINUX24_ENV
     printf("\ti_sem: count=%d, wait=0x%x\n", vep->i_sem.count,
@@ -2793,16 +2619,20 @@ print_vnode(kmem, vep, ptr, pnt)
     printf("\ti_sem: count=%d, waking=%d, wait=0x%x\n", vep->i_sem.count,
           vep->i_sem.waking, vep->i_sem.wait);
 #endif
+#ifdef AFS_LINUX26_ENV
+    printf("\ti_hash=0x%x:0x%x, i_list=0x%x:0x%x, i_dentry=0x%x:0x%x\n",
+          vep->i_hash.pprev, vep->i_hash.next, vep->i_list.prev,
+          vep->i_list.next, vep->i_dentry.prev, vep->i_dentry.next);
+#else /* AFS_LINUX26_ENV */
     printf("\ti_hash=0x%x:0x%x, i_list=0x%x:0x%x, i_dentry=0x%x:0x%x\n",
           vep->i_hash.prev, vep->i_hash.next, vep->i_list.prev,
           vep->i_list.next, vep->i_dentry.prev, vep->i_dentry.next);
+#endif /* AFS_LINUX26_ENV */
 #endif /* AFS_LINUX22_ENV */
 }
 
 void
-print_vcache(kmem, vep, ptr, pnt)
-     int kmem, pnt;
-     struct vcache *vep, *ptr;
+print_vcache(int kmem, struct vcache *vep, struct vcache *ptr, int pnt)
 {
     long *loc, j = 0;
     char *cloc;
@@ -2824,13 +2654,13 @@ print_vcache(kmem, vep, ptr, pnt)
            printf("\n");
 #ifdef AFS33
        printf("%lx: refC=%d, pv=%d, pu=%d, flushDv=%d.%d, mapDV=%d.%d, ",
-              ptr, vep->vrefCount, vep->parentVnode, vep->parentUnique,
+              ptr, VREFCOUNT(vep), vep->parentVnode, vep->parentUnique,
               vep->flushDV.high, vep->flushDV.low, vep->mapDV.high,
               vep->mapDV.low);
 #ifdef AFS_64BIT_CLIENT
        printf
            ("truncPos=(0x%x, 0x%x),\n\tcallb=x%lx, cbE=%d, opens=%d, XoW=%d, ",
-            (int)vep->truncPos >> 32, (int)vep->truncPos & 0xffffffff,
+            (int)(vep->truncPos >> 32), (int)(vep->truncPos & 0xffffffff),
             vep->callback, vep->cbExpires, vep->opens, vep->execsOrWriters);
 #else /* AFS_64BIT_CLIENT */
        printf("truncPos=%d,\n\tcallb=x%lx, cbE=%d, opens=%d, XoW=%d, ",
@@ -2842,15 +2672,11 @@ print_vcache(kmem, vep, ptr, pnt)
 #ifdef AFS_SUN5_ENV
        printf("vstates=x%x, ", vep->vstates);
 #endif /* AFS_SUN5_ENV */
-       printf("dchint=%x, anyA=0x%x\n", vep->h1.dchint, vep->anyAccess);
+       printf("dchint=%x, anyA=0x%x\n", vep->dchint, vep->anyAccess);
 #ifdef AFS_64BIT_CLIENT
-       printf("\tquick[dc=%x, stamp=%x, f=%x, min=%d, len=(0x%x, 0x%x)]\n",
-              vep->quick.dc, vep->quick.stamp, vep->quick.f,
-              vep->quick.minLoc, (int)vep->quick.len >> 32,
-              (int)vep->quick.len & 0xffffffff);
        printf
            ("\tmstat[len=(0x%x, 0x%x), DV=%d.%d, Date=%d, Owner=%d, Group=%d, Mode=0%o, linkc=%d]\n",
-            (int)vep->m.Length >> 32, (int)vep->m.Length & 0xffffffff,
+            (int)(vep->m.Length >> 32), (int)(vep->m.Length & 0xffffffff),
             vep->m.DataVersion.high, vep->m.DataVersion.low, vep->m.Date,
             vep->m.Owner, vep->m.Group, vep->m.Mode, vep->m.LinkCount);
 #else /* AFS_64BIT_CLIENT */
@@ -2937,15 +2763,13 @@ print_vcache(kmem, vep, ptr, pnt)
        }
     }
 #ifdef AFS_LINUX22_ENV
-    printf("\tflushcnt=%d, mapcnt=%d\n", vep->flushcnt, vep->mapcnt);
+    printf("\tmapcnt=%d\n", vep->mapcnt);
 #endif
 }
 
 
 void
-print_dcache(kmem, dcp, dp, pnt)
-     int kmem, pnt;
-     struct dcache *dcp, *dp;
+print_dcache(int kmem, struct dcache *dcp, struct dcache *dp, int pnt)
 {
     if (!pnt)
        return;
@@ -2963,22 +2787,19 @@ print_dcache(kmem, dcp, dp, pnt)
 #endif
 #ifdef AFS_SGI62_ENV
     printf
-       ("\tf.chunk=%d, f.inode=%lld, f.chunkBytes=%d, f.states=%x, stamp=%x\n",
-        dcp->f.chunk, dcp->f.inode, dcp->f.chunkBytes, dcp->f.states,
-        dcp->stamp);
+       ("\tf.chunk=%d, f.inode=%" AFS_INT64_FMT ", f.chunkBytes=%d, f.states=%x",
+        dcp->f.chunk, dcp->f.inode, dcp->f.chunkBytes, dcp->f.states);
 #else
     printf
-       ("\tf.chunk=%d, f.inode=%d, f.chunkBytes=%d, f.states=%x, stamp=%x\n",
-        dcp->f.chunk, dcp->f.inode, dcp->f.chunkBytes, dcp->f.states,
-        dcp->stamp);
+       ("\tf.chunk=%d, f.inode=%d, f.chunkBytes=%d, f.states=%x\n",
+        dcp->f.chunk, dcp->f.inode, dcp->f.chunkBytes, dcp->f.states);
 #endif
-    printf("\tlruq.prev=%lx, lruq.next=%lx, index=%d, ihint=%x\n",
-          dcp->lruq.prev, dcp->lruq.next, dcp->index, dcp->ihint);
+    printf("\tlruq.prev=%lx, lruq.next=%lx, index=%d\n",
+          dcp->lruq.prev, dcp->lruq.next, dcp->index);
 }
 
 void
-print_bkg(kmem)
-     int kmem;
+print_bkg(int kmem)
 {
     off_t symoff;
     struct brequest afs_brs[NBRS], ue, *uentry = &ue, *uep;
@@ -3011,8 +2832,7 @@ print_bkg(kmem)
 }
 
 void
-print_vlru(kmem)
-     int kmem;
+print_vlru(int kmem)
 {
     off_t symoff;
     struct vcache Ve, *Ventry = &Ve, *Vep, *tvc;
@@ -3024,17 +2844,6 @@ print_vlru(kmem)
     printf("\n\nPrinting vcache VLRU info (oldest first)...\n\n");
     findsym("afs_cacheStats", &symoff);
     kread(kmem, symoff, (char *)&maxvcount, sizeof maxvcount);
-#ifdef AFS_OSF_ENV
-    findsym("afs_maxvcount", &symoff);
-    kread(kmem, symoff, (char *)&maxvcount, sizeof maxvcount);
-    findsym("afs_vcount", &symoff);
-    kread(kmem, symoff, (char *)&vcount, sizeof vcount);
-    findsym("max_vnodes", &symoff);
-    kread(kmem, symoff, (char *)&nvnode, sizeof nvnode);
-    printf("max number of vcache entries = %d\n", maxvcount);
-    printf("number of vcaches in use = %d\n", vcount);
-    printf("total number of system vnode entries = %d\n", nvnode);
-#endif
     findsym("VLRU", &symoff);
     kread(kmem, symoff, (char *)&VLRU, sizeof VLRU);
     vlru_addr = (u_long) symoff;
@@ -3050,8 +2859,7 @@ print_vlru(kmem)
 }
 
 void
-print_dlru(kmem)
-     int kmem;
+print_dlru(int kmem)
 {
     off_t symoff;
     struct dcache Ve, *Ventry = &Ve, *Vep, *tdc;
@@ -3089,8 +2897,7 @@ print_dlru(kmem)
 }
 
 int
-print_gcpags(pnt)
-     int pnt;
+print_gcpags(int pnt)
 {
     off_t symoff;
     afs_int32 afs_gcpags;
@@ -3134,8 +2941,7 @@ struct callo {
 #endif
 
 void
-print_callout(kmem)
-     int kmem;
+print_callout(int kmem)
 {
     off_t symoff;
 #ifndef        AFS_AIX_ENV
@@ -3144,7 +2950,7 @@ print_callout(kmem)
     struct callo Co, *Coe = &Co, *Cop;
     struct tos To, *Toe = &To, *tos;
     struct trb Trb, *Trbe = &Trb, *trb;
-    register int i = 0;
+    int i = 0;
 
 
     printf("\n\nPrinting callout table info...\n\n");
@@ -3165,8 +2971,7 @@ print_callout(kmem)
 }
 
 void
-print_dnlc(kmem)
-     int kmem;
+print_dnlc(int kmem)
 {
     struct nc *nameHash[256];
 
@@ -3174,8 +2979,7 @@ print_dnlc(kmem)
 
 
 void
-print_global_locks(kmem)
-     int kmem;
+print_global_locks(int kmem)
 {
     off_t symoff;
     afs_int32 count;
@@ -3213,8 +3017,7 @@ print_global_locks(kmem)
 
 
 void
-print_global_afs_resource(kmem)
-     int kmem;
+print_global_afs_resource(int kmem)
 {
     off_t symoff;
     char sysname[100];
@@ -3251,8 +3054,7 @@ print_global_afs_resource(kmem)
 
 
 void
-print_global_afs_cache(kmem)
-     int kmem;
+print_global_afs_cache(int kmem)
 {
     off_t symoff;
     char sysname[100];
@@ -3268,11 +3070,9 @@ print_global_afs_cache(kmem)
     findsym("afs_mariner", &symoff);
     kread(kmem, symoff, (char *)&count, sizeof count);
     printf("\tafs_mariner = 0x%x\n", count);
-#ifndef        AFS_OSF_ENV
     findsym("freeVCList", &symoff);
     kread(kmem, symoff, (char *)&count, sizeof count);
     printf("\tafs_freeVCList = 0x%x XXX\n", count);
-#endif
     findsym("afs_freeDCList", &symoff);
     kread(kmem, symoff, (char *)&count, sizeof count);
     printf("\tfreeDCList = 0x%x\n", count);
@@ -3291,10 +3091,10 @@ print_global_afs_cache(kmem)
 #ifdef AFS_SGI62_ENV
     findsym("cacheInode", &symoff);
     kread(kmem, symoff, (char *)&inode, sizeof inode);
-    printf("\tcacheInode = 0x%llx (%lld)\n", inode, inode);
+    printf("\tcacheInode = 0x%llx (%" AFS_INT64_FMT ")\n", inode, inode);
     findsym("volumeInode", &symoff);
     kread(kmem, symoff, (char *)&inode, sizeof inode);
-    printf("\tvolumeInode = 0x%llx (%lld)\n", inode, inode);
+    printf("\tvolumeInode = 0x%llx (%" AFS_INT64_FMT ")\n", inode, inode);
 #else
     findsym("cacheInode", &symoff);
     kread(kmem, symoff, (char *)&count, sizeof count);
@@ -3348,13 +3148,12 @@ print_global_afs_cache(kmem)
 
 
 void
-print_rxstats(kmem)
-     int kmem;
+print_rxstats(int kmem)
 {
     off_t symoff;
     char sysname[100];
     afs_int32 count, i;
-    struct rx_stats rx_stats;
+    struct rx_statistics rx_stats;
 
     printf("\n\nPrinting some general RX stats...\n\n");
     findsym("rx_stats", &symoff);
@@ -3412,14 +3211,13 @@ print_rxstats(kmem)
 
 
 void
-print_rx(kmem)
-     int kmem;
+print_rx(int kmem)
 {
     off_t symoff;
     char sysname[100], c;
     afs_int32 count, i, ar[100];
     short sm;
-    struct rx_stats rx_stats;
+    struct rx_statistics rx_stats;
 
     printf("\n\nPrinting some RX globals...\n\n");
     findsym("rx_extraQuota", &symoff);
@@ -3538,8 +3336,7 @@ print_rx(kmem)
 
 
 void
-print_services(kmem)
-     afs_int32 kmem;
+print_services(afs_int32 kmem)
 {
     off_t symoff;
     struct rx_service *rx_services[RX_MAX_SERVICES], se, *sentry = &se, *sep;
@@ -3574,8 +3371,7 @@ print_services(kmem)
 
 #ifdef KDUMP_RX_LOCK
 void
-print_peertable_lock(kmem)
-     afs_int32 kmem;
+print_peertable_lock(afs_int32 kmem)
 {
     off_t symoff;
     struct rx_peer_rx_lock *rx_peerTable[256], se, *sentry = &se, *sep;
@@ -3614,8 +3410,7 @@ print_peertable_lock(kmem)
 
 #endif /* KDUMP_RX_LOCK */
 void
-print_peertable(kmem)
-     afs_int32 kmem;
+print_peertable(afs_int32 kmem)
 {
     off_t symoff;
     struct rx_peer *rx_peerTable[256], se, *sentry = &se, *sep;
@@ -3653,8 +3448,7 @@ print_peertable(kmem)
 
 #ifdef KDUMP_RX_LOCK
 void
-print_conntable_lock(kmem)
-     afs_int32 kmem;
+print_conntable_lock(afs_int32 kmem)
 {
     off_t symoff;
     struct rx_connection_rx_lock *rx_connTable[256], se, *sentry = &se;
@@ -3709,8 +3503,7 @@ print_conntable_lock(kmem)
 #endif /* KDUMP_RX_LOCK */
 
 void
-print_conntable(kmem)
-     afs_int32 kmem;
+print_conntable(afs_int32 kmem)
 {
     off_t symoff;
     struct rx_connection *rx_connTable[256], se, *sentry = &se, *sep;
@@ -3763,8 +3556,7 @@ print_conntable(kmem)
 
 #ifdef KDUMP_RX_LOCK
 void
-print_calltable_lock(kmem)
-     afs_int32 kmem;
+print_calltable_lock(afs_int32 kmem)
 {
     off_t symoff;
     struct rx_connection_rx_lock *rx_connTable[256], se;
@@ -3846,8 +3638,7 @@ print_calltable_lock(kmem)
 #endif /* KDUMP_RX_LOCK */
 
 void
-print_calltable(kmem)
-     afs_int32 kmem;
+print_calltable(afs_int32 kmem)
 {
     off_t symoff;
     struct rx_connection *rx_connTable[256], se, *sentry = &se, *sep;
@@ -3923,8 +3714,7 @@ print_calltable(kmem)
 }
 
 void
-print_eventtable(kmem)
-     afs_int32 kmem;
+print_eventtable(afs_int32 kmem)
 {
     off_t symoff;
     struct rx_queue epq;
@@ -3950,9 +3740,7 @@ print_eventtable(kmem)
  * provided.
  */
 void
-print_upDownStats(a_upDownP)
-     struct afs_stats_SrvUpDownInfo *a_upDownP;        /*Ptr to server up/down info */
-
+print_upDownStats(struct afs_stats_SrvUpDownInfo *a_upDownP)
 {                              /*print_upDownStats */
 
     /*
@@ -3996,8 +3784,7 @@ print_upDownStats(a_upDownP)
 
 
 void
-print_cmperfstats(perfP)
-     struct afs_stats_CMPerf *perfP;
+print_cmperfstats(struct afs_stats_CMPerf *perfP)
 {
     struct afs_stats_SrvUpDownInfo *upDownP;   /*Ptr to server up/down info */
 
@@ -4065,8 +3852,7 @@ print_cmperfstats(perfP)
 
 
 void
-print_cmstats(cmp)
-     struct afs_CMStats *cmp;
+print_cmstats(struct afs_CMStats *cmp)
 {
     printf("\t%10d afs_init\n", cmp->callInfo.C_afs_init);
     printf("\t%10d gop_rdwr\n", cmp->callInfo.C_gop_rdwr);
@@ -4398,7 +4184,6 @@ print_cmstats(cmp)
     printf("\t%10d afs_ConnByHost\n", cmp->callInfo.C_afs_ConnByHost);
     printf("\t%10d afs_ConnByMHosts\n", cmp->callInfo.C_afs_ConnByMHosts);
     printf("\t%10d afs_Analyze\n", cmp->callInfo.C_afs_Analyze);
-    printf("\t%10d afs_CheckLocks\n", cmp->callInfo.C_afs_CheckLocks);
     printf("\t%10d CheckVLServer\n", cmp->callInfo.C_CheckVLServer);
     printf("\t%10d afs_CheckCacheResets\n",
           cmp->callInfo.C_afs_CheckCacheResets);