Fix warnings in vlserver/vlprocs.c
[openafs.git] / src / vlserver / vlprocs.c
index 97c8afb..73f5658 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID
-    ("$Header$");
 
 #include <sys/types.h>
 #include <stdio.h>
+#include <string.h>
 #include <lock.h>
 #include <afs/afsutil.h>
 #include <ubik.h>
 #include <rx/xdr.h>
 #include <rx/rx.h>
+#include <rx/rxkad.h>
 #ifdef AFS_NT40_ENV
 #include <winsock2.h>
 #else
 #include <netinet/in.h>
 #endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
 #include <afs/keys.h>
+#include <afs/cellconfig.h>
 #include "vlserver.h"
+#include "vlserver_internal.h"
 #include "afs/audit.h"
 #ifndef AFS_NT40_ENV
 #include <unistd.h>
@@ -43,7 +38,7 @@ RCSID
 #endif
 
 extern int smallMem;
-extern extent_mod;
+extern int extent_mod;
 extern struct afsconf_dir *vldb_confdir;
 extern struct ubik_dbase *VL_dbase;
 struct vlheader cheader;       /* kept in network byte order */
@@ -58,36 +53,51 @@ static char rxinfo_str[128];        /* Need rxinfo string to be non-local */
 #define VLDBALLOCLIMIT 10000
 #define VLDBALLOCINCR  2048
 
-static int put_attributeentry();
-static int put_nattributeentry();
-static int RemoveEntry();
-static ReleaseEntry();
-static int check_vldbentry();
-static int check_nvldbentry();
-static int vldbentry_to_vlentry();
-static int nvldbentry_to_vlentry();
-static get_vldbupdateentry();
-static int repsite_exists();
-static repsite_compress();
-static vlentry_to_vldbentry();
-static vlentry_to_nvldbentry();
-static vlentry_to_uvldbentry();
-static int InvalidVolname();
-static int InvalidVoltype();
-static int InvalidOperation();
-static int InvalidReleasetype();
-static int IpAddrToRelAddr();
-static int ChangeIPAddr();
+static int put_attributeentry(struct vldbentry **, struct vldbentry **,
+                             struct vldbentry **, bulkentries *,
+                             struct nvlentry *, afs_int32 *, afs_int32 *);
+static int put_nattributeentry(struct nvldbentry **, struct nvldbentry **,
+                              struct nvldbentry **, nbulkentries *,
+                              struct nvlentry *, afs_int32, afs_int32,
+                              afs_int32 *, afs_int32 *);
+static int RemoveEntry(struct ubik_trans *trans, afs_int32 entryptr,
+                      struct nvlentry *tentry);
+static void ReleaseEntry(struct nvlentry *tentry, afs_int32 releasetype);
+static int check_vldbentry(struct vldbentry *aentry);
+static int check_nvldbentry(struct nvldbentry *aentry);
+static int vldbentry_to_vlentry(struct ubik_trans *atrans,
+                               struct vldbentry *VldbEntry,
+                               struct nvlentry *VlEntry);
+static int nvldbentry_to_vlentry(struct ubik_trans *atrans,
+                                struct nvldbentry *VldbEntry,
+                                struct nvlentry *VlEntry);
+static int get_vldbupdateentry(struct ubik_trans *trans, afs_int32 blockindex,
+                              struct VldbUpdateEntry *updateentry,
+                              struct nvlentry *VlEntry);
+static int repsite_exists(struct nvlentry *VlEntry, int server, int partition);
+static void repsite_compress(struct nvlentry *VlEntry, int offset);
+static void vlentry_to_vldbentry(struct nvlentry *VlEntry,
+                                struct vldbentry *VldbEntry);
+static void vlentry_to_nvldbentry(struct nvlentry *VlEntry,
+                                 struct nvldbentry *VldbEntry);
+static void vlentry_to_uvldbentry(struct nvlentry *VlEntry,
+                                 struct uvldbentry *VldbEntry);
+static int InvalidVolname(char *volname);
+static int InvalidVoltype(afs_int32 voltype);
+static int InvalidOperation(afs_int32 voloper);
+static int InvalidReleasetype(afs_int32 releasetype);
+static int IpAddrToRelAddr(afs_uint32 ipaddr, struct ubik_trans *atrans);
+static int ChangeIPAddr(afs_uint32 ipaddr1, afs_uint32 ipaddr2,
+                       struct ubik_trans *atrans);
 
 char *
-rxinfo(rxcall)
-     struct rx_call *rxcall;
+rxinfo(struct rx_call *rxcall)
 {
     int code;
     register struct rx_connection *tconn;
-    char tname[64];
-    char tinst[64];
-    char tcell[64];
+    char tname[64] = "";
+    char tinst[64] = "";
+    char tcell[64] = "";
     afs_uint32 exp;
     struct in_addr hostAddr;
 
@@ -98,7 +108,10 @@ rxinfo(rxcall)
                            NULL);
     if (!code)
        sprintf(rxinfo_str, "%s %s%s%s%s%s", inet_ntoa(hostAddr), tname,
-               tinst?".":"", tinst?tinst:"", tcell?"@":"", tcell?tcell:"");
+               (tinst[0] == '\0') ? "" : ".",
+               (tinst[0] == '\0') ? "" : tinst,
+               (tcell[0] == '\0') ? "" : "@",
+               (tcell[0] == '\0') ? "" : tcell);
     else
        sprintf(rxinfo_str, "%s noauth", inet_ntoa(hostAddr));
     return (rxinfo_str);
@@ -106,10 +119,9 @@ rxinfo(rxcall)
 
 /* This is called to initialize the database, set the appropriate locks and make sure that the vldb header is valid */
 int
-Init_VLdbase(trans, locktype, this_op)
-     struct ubik_trans **trans;
-     int locktype;             /* indicate read or write transaction */
-     int this_op;
+Init_VLdbase(struct ubik_trans **trans,
+            int locktype,      /* indicate read or write transaction */
+            int this_op)
 {
     int errorcode = 0, pass, wl;
 
@@ -161,12 +173,12 @@ Init_VLdbase(trans, locktype, this_op)
 }
 
 
-/* Create a new vldb entry; both new volume id and name must be unique (non-existant in vldb). */
+/* Create a new vldb entry; both new volume id and name must be unique
+ * (non-existant in vldb).
+ */
 
 afs_int32
-SVL_CreateEntry(rxcall, newentry)
-     struct rx_call *rxcall;
-     struct vldbentry *newentry;
+SVL_CreateEntry(struct rx_call *rxcall, struct vldbentry *newentry)
 {
     struct ubik_trans *trans;
     afs_int32 errorcode, blockindex;
@@ -212,7 +224,7 @@ SVL_CreateEntry(rxcall, newentry)
 
     memset(&tentry, 0, sizeof(struct nvlentry));
     /* Convert to its internal representation; both in host byte order */
-    if (errorcode = vldbentry_to_vlentry(trans, newentry, &tentry)) {
+    if ((errorcode = vldbentry_to_vlentry(trans, newentry, &tentry))) {
        FreeBlock(trans, blockindex);
        goto abort;
     }
@@ -239,9 +251,7 @@ SVL_CreateEntry(rxcall, newentry)
 
 
 afs_int32
-SVL_CreateEntryN(rxcall, newentry)
-     struct rx_call *rxcall;
-     struct nvldbentry *newentry;
+SVL_CreateEntryN(struct rx_call *rxcall, struct nvldbentry *newentry)
 {
     struct ubik_trans *trans;
     afs_int32 errorcode, blockindex;
@@ -287,7 +297,7 @@ SVL_CreateEntryN(rxcall, newentry)
 
     memset(&tentry, 0, sizeof(struct nvlentry));
     /* Convert to its internal representation; both in host byte order */
-    if (errorcode = nvldbentry_to_vlentry(trans, newentry, &tentry)) {
+    if ((errorcode = nvldbentry_to_vlentry(trans, newentry, &tentry))) {
        FreeBlock(trans, blockindex);
        goto abort;
     }
@@ -314,9 +324,7 @@ SVL_CreateEntryN(rxcall, newentry)
 
 
 afs_int32
-SVL_ChangeAddr(rxcall, ip1, ip2)
-     struct rx_call *rxcall;
-     afs_int32 ip1, ip2;
+SVL_ChangeAddr(struct rx_call *rxcall, afs_uint32 ip1, afs_uint32 ip2)
 {
     struct ubik_trans *trans;
     afs_int32 errorcode;
@@ -327,11 +335,11 @@ SVL_ChangeAddr(rxcall, ip1, ip2)
        goto end;
     }
 
-    if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op)))
        goto end;
 
-    VLog(1, ("Change Addr %d -> %d %s\n", ip1, ip2, rxinfo(rxcall)));
-    if (errorcode = ChangeIPAddr(ip1, ip2, trans))
+    VLog(1, ("Change Addr %u -> %u %s\n", ip1, ip2, rxinfo(rxcall)));
+    if ((errorcode = ChangeIPAddr(ip1, ip2, trans)))
        goto abort;
     else {
        errorcode = ubik_EndTrans(trans);
@@ -350,10 +358,7 @@ SVL_ChangeAddr(rxcall, ip1, ip2)
 
 /* Delete a vldb entry given the volume id. */
 afs_int32
-SVL_DeleteEntry(rxcall, volid, voltype)
-     struct rx_call *rxcall;
-     afs_int32 volid;
-     afs_int32 voltype;
+SVL_DeleteEntry(struct rx_call *rxcall, afs_uint32 volid, afs_int32 voltype)
 {
     struct ubik_trans *trans;
     afs_int32 blockindex, errorcode;
@@ -366,10 +371,10 @@ SVL_DeleteEntry(rxcall, volid, voltype)
     if ((voltype != -1) && (InvalidVoltype(voltype)))
        END(VL_BADVOLTYPE);
 
-    if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op)))
        goto end;
 
-    VLog(1, ("Delete Volume %d %s\n", volid, rxinfo(rxcall)));
+    VLog(1, ("Delete Volume %u %s\n", volid, rxinfo(rxcall)));
     blockindex = FindByID(trans, volid, voltype, &tentry, &errorcode);
     if (blockindex == 0) {     /* volid not found */
        if (!errorcode)
@@ -380,7 +385,7 @@ SVL_DeleteEntry(rxcall, volid, voltype)
     if (tentry.flags & VLDELETED) {    /* Already deleted; return */
        ABORT(VL_ENTDELETED);
     }
-    if (errorcode = RemoveEntry(trans, blockindex, &tentry)) {
+    if ((errorcode = RemoveEntry(trans, blockindex, &tentry))) {
        goto abort;
     }
     errorcode = (ubik_EndTrans(trans));
@@ -398,11 +403,13 @@ SVL_DeleteEntry(rxcall, volid, voltype)
 
 
 /* Get a vldb entry given its volume id; make sure it's not a deleted entry. */
-GetEntryByID(rxcall, volid, voltype, aentry, new, this_op)
-     struct rx_call *rxcall;
-     afs_int32 volid;
-     afs_int32 voltype, new, this_op;
-     char *aentry;             /* entry data copied here */
+int
+GetEntryByID(struct rx_call *rxcall,
+            afs_uint32 volid,
+            afs_int32 voltype,
+            char *aentry,      /* entry data copied here */
+            afs_int32 new,
+            afs_int32 this_op)
 {
     struct ubik_trans *trans;
     afs_int32 blockindex, errorcode;
@@ -410,10 +417,10 @@ GetEntryByID(rxcall, volid, voltype, aentry, new, this_op)
 
     if ((voltype != -1) && (InvalidVoltype(voltype)))
        return VL_BADVOLTYPE;
-    if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKREAD, this_op)))
        return errorcode;
 
-    VLog(5, ("GetVolumeByID %d (%d) %s\n", volid, new, rxinfo(rxcall)));
+    VLog(5, ("GetVolumeByID %u (%d) %s\n", volid, new, rxinfo(rxcall)));
     blockindex = FindByID(trans, volid, voltype, &tentry, &errorcode);
     if (blockindex == 0) {     /* entry not found */
        if (!errorcode)
@@ -438,30 +445,30 @@ GetEntryByID(rxcall, volid, voltype, aentry, new, this_op)
 }
 
 afs_int32
-SVL_GetEntryByID(rxcall, volid, voltype, aentry)
-     struct rx_call *rxcall;
-     afs_int32 volid, voltype;
-     vldbentry *aentry;                /* entry data copied here */
+SVL_GetEntryByID(struct rx_call *rxcall,
+                afs_uint32 volid,
+                afs_int32 voltype,
+                vldbentry *aentry)             /* entry data copied here */
 {
     COUNT_REQ(VLGETENTRYBYID);
     return (GetEntryByID(rxcall, volid, voltype, (char *)aentry, 0, this_op));
 }
 
 afs_int32
-SVL_GetEntryByIDN(rxcall, volid, voltype, aentry)
-     struct rx_call *rxcall;
-     afs_int32 volid, voltype;
-     nvldbentry *aentry;       /* entry data copied here */
+SVL_GetEntryByIDN(struct rx_call *rxcall,
+                 afs_uint32 volid,
+                 afs_int32 voltype,
+                 nvldbentry *aentry)   /* entry data copied here */
 {
     COUNT_REQ(VLGETENTRYBYIDN);
     return (GetEntryByID(rxcall, volid, voltype, (char *)aentry, 1, this_op));
 }
 
 afs_int32
-SVL_GetEntryByIDU(rxcall, volid, voltype, aentry)
-     struct rx_call *rxcall;
-     afs_int32 volid, voltype;
-     uvldbentry *aentry;       /* entry data copied here */
+SVL_GetEntryByIDU(struct rx_call *rxcall,
+                 afs_uint32 volid,
+                 afs_int32 voltype,
+                 uvldbentry *aentry)   /* entry data copied here */
 {
     COUNT_REQ(VLGETENTRYBYIDU);
     return (GetEntryByID(rxcall, volid, voltype, (char *)aentry, 2, this_op));
@@ -469,26 +476,27 @@ SVL_GetEntryByIDU(rxcall, volid, voltype, aentry)
 
 
 
-/* returns true if the id is a decimal integer, in which case we interpret it
-    as an id.  make the cache manager much simpler */
+/* returns true if the id is a decimal integer, in which case we interpret
+ * it as an id.  make the cache manager much simpler */
 static int
-NameIsId(aname)
-     register char *aname;
+NameIsId(char *aname)
 {
     register int tc;
-    while (tc = *aname++) {
+    while ((tc = *aname++)) {
        if (tc > '9' || tc < '0')
            return 0;
     }
     return 1;
 }
 
-/* Get a vldb entry given the volume's name; of course, very similar to VLGetEntryByID() above. */
-GetEntryByName(rxcall, volname, aentry, new, this_op)
-     struct rx_call *rxcall;
-     char *volname;
-     char *aentry;             /* entry data copied here */
-     int new, this_op;
+/* Get a vldb entry given the volume's name; of course, very similar to
+ * VLGetEntryByID() above. */
+afs_int32
+GetEntryByName(struct rx_call *rxcall,
+              char *volname,
+              char *aentry,            /* entry data copied here */
+              int new,
+              int this_op)
 {
     struct ubik_trans *trans;
     afs_int32 blockindex, errorcode;
@@ -499,7 +507,7 @@ GetEntryByName(rxcall, volname, aentry, new, this_op)
     }
     if (InvalidVolname(volname))
        return VL_BADNAME;
-    if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKREAD, this_op)))
        return errorcode;
     VLog(5, ("GetVolumeByName %s (%d) %s\n", volname, new, rxinfo(rxcall)));
     blockindex = FindByName(trans, volname, &tentry, &errorcode);
@@ -526,10 +534,9 @@ GetEntryByName(rxcall, volname, aentry, new, this_op)
 }
 
 afs_int32
-SVL_GetEntryByNameO(rxcall, volname, aentry)
-     struct rx_call *rxcall;
-     char *volname;
-     struct vldbentry *aentry; /* entry data copied here */
+SVL_GetEntryByNameO(struct rx_call *rxcall,
+                   char *volname,
+                   struct vldbentry *aentry)   /* entry data copied here */
 {
     COUNT_REQ(VLGETENTRYBYNAME);
     return (GetEntryByName(rxcall, volname, (char *)aentry, 0, this_op));
@@ -537,20 +544,18 @@ SVL_GetEntryByNameO(rxcall, volname, aentry)
 
 
 afs_int32
-SVL_GetEntryByNameN(rxcall, volname, aentry)
-     struct rx_call *rxcall;
-     char *volname;
-     struct nvldbentry *aentry;        /* entry data copied here */
+SVL_GetEntryByNameN(struct rx_call *rxcall,
+                   char *volname,
+                   struct nvldbentry *aentry)  /* entry data copied here */
 {
     COUNT_REQ(VLGETENTRYBYNAMEN);
     return (GetEntryByName(rxcall, volname, (char *)aentry, 1, this_op));
 }
 
 afs_int32
-SVL_GetEntryByNameU(rxcall, volname, aentry)
-     struct rx_call *rxcall;
-     char *volname;
-     struct uvldbentry *aentry;        /* entry data copied here */
+SVL_GetEntryByNameU(struct rx_call *rxcall,
+                   char *volname,
+                   struct uvldbentry *aentry)  /* entry data copied here */
 {
     COUNT_REQ(VLGETENTRYBYNAMEU);
     return (GetEntryByName(rxcall, volname, (char *)aentry, 2, this_op));
@@ -560,12 +565,11 @@ SVL_GetEntryByNameU(rxcall, volname, aentry)
 
 /* Get the current value of the maximum volume id and bump the volume id counter by Maxvolidbump. */
 afs_int32
-SVL_GetNewVolumeId(rxcall, Maxvolidbump, newvolumeid)
-     struct rx_call *rxcall;
-     afs_int32 Maxvolidbump;
-     afs_int32 *newvolumeid;
+SVL_GetNewVolumeId(struct rx_call *rxcall, afs_uint32 Maxvolidbump,
+                  afs_uint32 *newvolumeid)
 {
-    register afs_int32 errorcode, maxvolumeid;
+    register afs_int32 errorcode;
+    afs_uint32 maxvolumeid;
     struct ubik_trans *trans;
 
     COUNT_REQ(VLGETNEWVOLUMEID);
@@ -575,12 +579,12 @@ SVL_GetNewVolumeId(rxcall, Maxvolidbump, newvolumeid)
     if (Maxvolidbump < 0 || Maxvolidbump > MAXBUMPCOUNT)
        END(VL_BADVOLIDBUMP);
 
-    if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op)))
        goto end;
 
     *newvolumeid = maxvolumeid = ntohl(cheader.vital_header.MaxVolumeId);
     maxvolumeid += Maxvolidbump;
-    VLog(1, ("GetNewVolid newmax=%d %s\n", maxvolumeid, rxinfo(rxcall)));
+    VLog(1, ("GetNewVolid newmax=%u %s\n", maxvolumeid, rxinfo(rxcall)));
     cheader.vital_header.MaxVolumeId = htonl(maxvolumeid);
     if (write_vital_vlheader(trans)) {
        ABORT(VL_IO);
@@ -603,12 +607,8 @@ SVL_GetNewVolumeId(rxcall, Maxvolidbump, newvolumeid)
  * VLUpdateEntry) is done. */
 
 afs_int32
-SVL_ReplaceEntry(rxcall, volid, voltype, newentry, releasetype)
-     struct rx_call *rxcall;
-     afs_int32 volid;
-     afs_int32 voltype;
-     struct vldbentry *newentry;
-     afs_int32 releasetype;
+SVL_ReplaceEntry(struct rx_call *rxcall, afs_uint32 volid, afs_int32 voltype,
+                struct vldbentry *newentry, afs_int32 releasetype)
 {
     struct ubik_trans *trans;
     afs_int32 blockindex, errorcode, typeindex;
@@ -623,7 +623,7 @@ SVL_ReplaceEntry(rxcall, volid, voltype, newentry, releasetype)
     if (!afsconf_SuperUser(vldb_confdir, rxcall, NULL))
        END(VL_PERM);
 
-    if (errorcode = check_vldbentry(newentry))
+    if ((errorcode = check_vldbentry(newentry)))
        goto end;
 
     if (voltype != -1 && InvalidVoltype(voltype))
@@ -631,10 +631,10 @@ SVL_ReplaceEntry(rxcall, volid, voltype, newentry, releasetype)
 
     if (releasetype && InvalidReleasetype(releasetype))
        END(VL_BADRELLOCKTYPE);
-    if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op)))
        goto end;
 
-    VLog(1, ("OReplace Volume %d %s\n", volid, rxinfo(rxcall)));
+    VLog(1, ("OReplace Volume %u %s\n", volid, rxinfo(rxcall)));
     /* find vlentry we're changing */
     blockindex = FindByID(trans, volid, voltype, &tentry, &errorcode);
     if (blockindex == 0) {     /* entry not found */
@@ -654,8 +654,8 @@ SVL_ReplaceEntry(rxcall, volid, voltype, newentry, releasetype)
     for (typeindex = ROVOL; typeindex <= BACKVOL; typeindex++) {
        if (tentry.volumeId[typeindex] != newentry->volumeId[typeindex]) {
            if (tentry.volumeId[typeindex])
-               if (errorcode =
-                   UnhashVolid(trans, typeindex, blockindex, &tentry)) {
+               if ((errorcode =
+                   UnhashVolid(trans, typeindex, blockindex, &tentry))) {
                    goto abort;
                }
            /* we must rehash new id if the id is different and the ID is nonzero */
@@ -665,7 +665,7 @@ SVL_ReplaceEntry(rxcall, volid, voltype, newentry, releasetype)
 
     /* Rehash volname if it changes */
     if (strcmp(newentry->name, tentry.name)) { /* Name changes; redo hashing */
-       if (errorcode = UnhashVolname(trans, blockindex, &tentry)) {
+       if ((errorcode = UnhashVolname(trans, blockindex, &tentry))) {
            goto abort;
        }
        hashnewname = 1;
@@ -673,13 +673,13 @@ SVL_ReplaceEntry(rxcall, volid, voltype, newentry, releasetype)
 
     /* after this, tentry is new entry, not old one.  vldbentry_to_vlentry
      * doesn't touch hash chains */
-    if (errorcode = vldbentry_to_vlentry(trans, newentry, &tentry)) {
+    if ((errorcode = vldbentry_to_vlentry(trans, newentry, &tentry))) {
        goto abort;
     }
 
     for (typeindex = ROVOL; typeindex <= BACKVOL; typeindex++) {
        if (hashVol[typeindex] && tentry.volumeId[typeindex]) {
-           if (errorcode = HashVolid(trans, typeindex, blockindex, &tentry)) {
+           if ((errorcode = HashVolid(trans, typeindex, blockindex, &tentry))) {
                goto abort;
            }
        }
@@ -707,12 +707,8 @@ SVL_ReplaceEntry(rxcall, volid, voltype, newentry, releasetype)
 }
 
 afs_int32
-SVL_ReplaceEntryN(rxcall, volid, voltype, newentry, releasetype)
-     struct rx_call *rxcall;
-     afs_int32 volid;
-     afs_int32 voltype;
-     struct nvldbentry *newentry;
-     afs_int32 releasetype;
+SVL_ReplaceEntryN(struct rx_call *rxcall, afs_uint32 volid, afs_int32 voltype,
+                 struct nvldbentry *newentry, afs_int32 releasetype)
 {
     struct ubik_trans *trans;
     afs_int32 blockindex, errorcode, typeindex;
@@ -727,7 +723,7 @@ SVL_ReplaceEntryN(rxcall, volid, voltype, newentry, releasetype)
     if (!afsconf_SuperUser(vldb_confdir, rxcall, NULL))
        END(VL_PERM);
 
-    if (errorcode = check_nvldbentry(newentry))
+    if ((errorcode = check_nvldbentry(newentry)))
        goto end;
 
     if (voltype != -1 && InvalidVoltype(voltype))
@@ -735,10 +731,10 @@ SVL_ReplaceEntryN(rxcall, volid, voltype, newentry, releasetype)
 
     if (releasetype && InvalidReleasetype(releasetype))
        END(VL_BADRELLOCKTYPE);
-    if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op)))
        goto end;
 
-    VLog(1, ("Replace Volume %d %s\n", volid, rxinfo(rxcall)));
+    VLog(1, ("Replace Volume %u %s\n", volid, rxinfo(rxcall)));
     /* find vlentry we're changing */
     blockindex = FindByID(trans, volid, voltype, &tentry, &errorcode);
     if (blockindex == 0) {     /* entry not found */
@@ -758,8 +754,8 @@ SVL_ReplaceEntryN(rxcall, volid, voltype, newentry, releasetype)
     for (typeindex = ROVOL; typeindex <= BACKVOL; typeindex++) {
        if (tentry.volumeId[typeindex] != newentry->volumeId[typeindex]) {
            if (tentry.volumeId[typeindex])
-               if (errorcode =
-                   UnhashVolid(trans, typeindex, blockindex, &tentry)) {
+               if ((errorcode =
+                   UnhashVolid(trans, typeindex, blockindex, &tentry))) {
                    goto abort;
                }
            /* we must rehash new id if the id is different and the ID is nonzero */
@@ -769,7 +765,7 @@ SVL_ReplaceEntryN(rxcall, volid, voltype, newentry, releasetype)
 
     /* Rehash volname if it changes */
     if (strcmp(newentry->name, tentry.name)) { /* Name changes; redo hashing */
-       if (errorcode = UnhashVolname(trans, blockindex, &tentry)) {
+       if ((errorcode = UnhashVolname(trans, blockindex, &tentry))) {
            goto abort;
        }
        hashnewname = 1;
@@ -777,13 +773,13 @@ SVL_ReplaceEntryN(rxcall, volid, voltype, newentry, releasetype)
 
     /* after this, tentry is new entry, not old one.  vldbentry_to_vlentry
      * doesn't touch hash chains */
-    if (errorcode = nvldbentry_to_vlentry(trans, newentry, &tentry)) {
+    if ((errorcode = nvldbentry_to_vlentry(trans, newentry, &tentry))) {
        goto abort;
     }
 
     for (typeindex = ROVOL; typeindex <= BACKVOL; typeindex++) {
        if (hashVol[typeindex] && tentry.volumeId[typeindex]) {
-           if (errorcode = HashVolid(trans, typeindex, blockindex, &tentry)) {
+           if ((errorcode = HashVolid(trans, typeindex, blockindex, &tentry))) {
                goto abort;
            }
        }
@@ -811,15 +807,17 @@ SVL_ReplaceEntryN(rxcall, volid, voltype, newentry, releasetype)
 }
 
 
-/* Update a vldb entry (accessed thru its volume id). Almost all of the entry's fields can be modified in a single call by setting the appropriate bits in the Mask field in VldbUpdateentry. */
-/* this routine may never have been tested; use replace entry instead unless you're brave */
+/* Update a vldb entry (accessed thru its volume id). Almost all of the
+ * entry's fields can be modified in a single call by setting the
+ * appropriate bits in the Mask field in VldbUpdateentry. */
+/* this routine may never have been tested; use replace entry instead
+ * unless you're brave */
 afs_int32
-SVL_UpdateEntry(rxcall, volid, voltype, updateentry, releasetype)
-     struct rx_call *rxcall;
-     afs_int32 volid;
-     afs_int32 voltype;
-     afs_int32 releasetype;
-     struct VldbUpdateEntry *updateentry;      /* Update entry copied here */
+SVL_UpdateEntry(struct rx_call *rxcall,
+               afs_uint32 volid,
+               afs_int32 voltype,
+               struct VldbUpdateEntry *updateentry,    /* Update entry copied here */
+               afs_int32 releasetype)
 {
     struct ubik_trans *trans;
     afs_int32 blockindex, errorcode;
@@ -832,10 +830,10 @@ SVL_UpdateEntry(rxcall, volid, voltype, updateentry, releasetype)
        END(VL_BADVOLTYPE);
     if (releasetype && InvalidReleasetype(releasetype))
        END(VL_BADRELLOCKTYPE);
-    if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op)))
        goto end;
 
-    VLog(1, ("Update Volume %d %s\n", volid, rxinfo(rxcall)));
+    VLog(1, ("Update Volume %u %s\n", volid, rxinfo(rxcall)));
     blockindex = FindByID(trans, volid, voltype, &tentry, &errorcode);
     if (blockindex == 0) {     /* entry not found */
        if (!errorcode)
@@ -844,8 +842,8 @@ SVL_UpdateEntry(rxcall, volid, voltype, updateentry, releasetype)
     }
 
     /* Do the actual updating of the entry, tentry. */
-    if (errorcode =
-       get_vldbupdateentry(trans, blockindex, updateentry, &tentry)) {
+    if ((errorcode =
+       get_vldbupdateentry(trans, blockindex, updateentry, &tentry))) {
        goto abort;
     }
     if (releasetype)
@@ -867,11 +865,10 @@ SVL_UpdateEntry(rxcall, volid, voltype, updateentry, releasetype)
 
 
 afs_int32
-SVL_UpdateEntryByName(rxcall, volname, updateentry, releasetype)
-     struct rx_call *rxcall;
-     char *volname;
-     afs_int32 releasetype;
-     struct VldbUpdateEntry *updateentry;      /* Update entry copied here */
+SVL_UpdateEntryByName(struct rx_call *rxcall,
+                     char *volname,
+                     struct VldbUpdateEntry *updateentry, /* Update entry copied here */
+                     afs_int32 releasetype)
 {
     struct ubik_trans *trans;
     afs_int32 blockindex, errorcode;
@@ -882,7 +879,7 @@ SVL_UpdateEntryByName(rxcall, volname, updateentry, releasetype)
        END(VL_PERM);
     if (releasetype && InvalidReleasetype(releasetype))
        END(VL_BADRELLOCKTYPE);
-    if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op)))
        goto end;
 
     blockindex = FindByName(trans, volname, &tentry, &errorcode);
@@ -893,8 +890,8 @@ SVL_UpdateEntryByName(rxcall, volname, updateentry, releasetype)
     }
 
     /* Do the actual updating of the entry, tentry. */
-    if (errorcode =
-       get_vldbupdateentry(trans, blockindex, updateentry, &tentry)) {
+    if ((errorcode =
+       get_vldbupdateentry(trans, blockindex, updateentry, &tentry))) {
        goto abort;
     }
     if (releasetype)
@@ -916,11 +913,8 @@ SVL_UpdateEntryByName(rxcall, volname, updateentry, releasetype)
 
 /* Set a lock to the vldb entry for volid (of type voltype if not -1). */
 afs_int32
-SVL_SetLock(rxcall, volid, voltype, voloper)
-     struct rx_call *rxcall;
-     afs_int32 volid;
-     afs_int32 voltype;
-     afs_int32 voloper;
+SVL_SetLock(struct rx_call *rxcall, afs_uint32 volid, afs_int32 voltype,
+           afs_int32 voloper)
 {
     afs_int32 timestamp, blockindex, errorcode;
     struct ubik_trans *trans;
@@ -933,10 +927,10 @@ SVL_SetLock(rxcall, volid, voltype, voloper)
        END(VL_BADVOLTYPE);
     if (InvalidOperation(voloper))
        END(VL_BADVOLOPER);
-    if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op)))
        goto end;
 
-    VLog(1, ("SetLock Volume %d %s\n", volid, rxinfo(rxcall)));
+    VLog(1, ("SetLock Volume %u %s\n", volid, rxinfo(rxcall)));
     blockindex = FindByID(trans, volid, voltype, &tentry, &errorcode);
     if (blockindex == NULLO) {
        if (!errorcode)
@@ -985,11 +979,8 @@ SVL_SetLock(rxcall, volid, voltype, voloper)
  * the lock time stamp. */
 
 afs_int32
-SVL_ReleaseLock(rxcall, volid, voltype, releasetype)
-     struct rx_call *rxcall;
-     afs_int32 volid;
-     afs_int32 voltype;
-     afs_int32 releasetype;
+SVL_ReleaseLock(struct rx_call *rxcall, afs_uint32 volid, afs_int32 voltype,
+               afs_int32 releasetype)
 {
     afs_int32 blockindex, errorcode;
     struct ubik_trans *trans;
@@ -1002,10 +993,10 @@ SVL_ReleaseLock(rxcall, volid, voltype, releasetype)
        END(VL_BADVOLTYPE);
     if (releasetype && InvalidReleasetype(releasetype))
        END(VL_BADRELLOCKTYPE);
-    if (errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKWRITE, this_op)))
        goto end;
 
-    VLog(1, ("ReleaseLock Volume %d %s\n", volid, rxinfo(rxcall)));
+    VLog(1, ("ReleaseLock Volume %u %s\n", volid, rxinfo(rxcall)));
     blockindex = FindByID(trans, volid, voltype, &tentry, &errorcode);
     if (blockindex == NULLO) {
        if (!errorcode)
@@ -1033,21 +1024,21 @@ SVL_ReleaseLock(rxcall, volid, voltype, releasetype)
 }
 
 
-/* ListEntry returns a single vldb entry, aentry, with offset previous_index; the remaining parameters (i.e. next_index) are used so that sequential calls to this routine will get the next (all) vldb entries. */
+/* ListEntry returns a single vldb entry, aentry, with offset previous_index;
+ * the remaining parameters (i.e. next_index) are used so that sequential
+ * calls to this routine will get the next (all) vldb entries.
+ */
 afs_int32
-SVL_ListEntry(rxcall, previous_index, count, next_index, aentry)
-     struct rx_call *rxcall;
-     afs_int32 previous_index;
-     afs_int32 *count;
-     afs_int32 *next_index;
-     struct vldbentry *aentry;
+SVL_ListEntry(struct rx_call *rxcall, afs_int32 previous_index,
+             afs_int32 *count, afs_int32 *next_index,
+             struct vldbentry *aentry)
 {
     int errorcode;
     struct ubik_trans *trans;
     struct nvlentry tentry;
 
     COUNT_REQ(VLLISTENTRY);
-    if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKREAD, this_op)))
        return errorcode;
     VLog(25, ("OListEntry index=%d %s\n", previous_index, rxinfo(rxcall)));
     *next_index = NextEntry(trans, previous_index, &tentry, count);
@@ -1056,21 +1047,21 @@ SVL_ListEntry(rxcall, previous_index, count, next_index, aentry)
     return (ubik_EndTrans(trans));
 }
 
-/* ListEntry returns a single vldb entry, aentry, with offset previous_index; the remaining parameters (i.e. next_index) are used so that sequential calls to this routine will get the next (all) vldb entries. */
+/* ListEntry returns a single vldb entry, aentry, with offset previous_index;
+ * the remaining parameters (i.e. next_index) are used so that sequential
+ * calls to this routine will get the next (all) vldb entries.
+ */
 afs_int32
-SVL_ListEntryN(rxcall, previous_index, count, next_index, aentry)
-     struct rx_call *rxcall;
-     afs_int32 previous_index;
-     afs_int32 *count;
-     afs_int32 *next_index;
-     struct nvldbentry *aentry;
+SVL_ListEntryN(struct rx_call *rxcall, afs_int32 previous_index,
+              afs_int32 *count, afs_int32 *next_index,
+              struct nvldbentry *aentry)
 {
     int errorcode;
     struct ubik_trans *trans;
     struct nvlentry tentry;
 
     COUNT_REQ(VLLISTENTRYN);
-    if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKREAD, this_op)))
        return errorcode;
     VLog(25, ("ListEntry index=%d %s\n", previous_index, rxinfo(rxcall)));
     *next_index = NextEntry(trans, previous_index, &tentry, count);
@@ -1080,13 +1071,17 @@ SVL_ListEntryN(rxcall, previous_index, count, next_index, aentry)
 }
 
 
-/* Retrieves in vldbentries all vldb entries that match the specified attributes (by server number, partition, volume type, and flag); if volume id is specified then the associated list for that entry is returned. CAUTION: This could be a very expensive call since in most cases sequential search of all vldb entries is performed. */
+/* Retrieves in vldbentries all vldb entries that match the specified
+ * attributes (by server number, partition, volume type, and flag); if volume
+ * id is specified then the associated list for that entry is returned.
+ * CAUTION: This could be a very expensive call since in most cases
+ * sequential search of all vldb entries is performed.
+ */
 afs_int32
-SVL_ListAttributes(rxcall, attributes, nentries, vldbentries)
-     struct rx_call *rxcall;
-     struct VldbListByAttributes *attributes;
-     afs_int32 *nentries;
-     bulkentries *vldbentries;
+SVL_ListAttributes(struct rx_call *rxcall,
+                  struct VldbListByAttributes *attributes,
+                  afs_int32 *nentries,
+                  bulkentries *vldbentries)
 {
     int errorcode, allocCount = 0;
     struct ubik_trans *trans;
@@ -1097,7 +1092,7 @@ SVL_ListAttributes(rxcall, attributes, nentries, vldbentries)
     COUNT_REQ(VLLISTATTRIBUTES);
     vldbentries->bulkentries_val = 0;
     vldbentries->bulkentries_len = *nentries = 0;
-    if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKREAD, this_op)))
        return errorcode;
     allocCount = VLDBALLOCCOUNT;
     Vldbentry = VldbentryFirst = vldbentries->bulkentries_val =
@@ -1108,7 +1103,8 @@ SVL_ListAttributes(rxcall, attributes, nentries, vldbentries)
        return VL_NOMEM;
     }
     VldbentryLast = VldbentryFirst + allocCount;
-    /* Handle the attribute by volume id totally separate of the rest (thus additional Mask values are ignored if VLLIST_VOLUMEID is set!) */
+    /* Handle the attribute by volume id totally separate of the rest
+     * (thus additional Mask values are ignored if VLLIST_VOLUMEID is set!) */
     if (attributes->Mask & VLLIST_VOLUMEID) {
        afs_int32 blockindex;
 
@@ -1125,9 +1121,9 @@ SVL_ListAttributes(rxcall, attributes, nentries, vldbentries)
            vldbentries->bulkentries_len = 0;
            return errorcode;
        }
-       if (errorcode =
+       if ((errorcode =
            put_attributeentry(&Vldbentry, &VldbentryFirst, &VldbentryLast,
-                              vldbentries, &tentry, nentries, &allocCount)) {
+                              vldbentries, &tentry, nentries, &allocCount))) {
            COUNT_ABO;
            ubik_AbortTrans(trans);
            if (vldbentries->bulkentries_val)
@@ -1137,19 +1133,20 @@ SVL_ListAttributes(rxcall, attributes, nentries, vldbentries)
            return VL_SIZEEXCEEDED;
        }
     } else {
-       afs_int32 nextblockindex = 0, count = 0, k, match = 0;
-       while (nextblockindex =
-              NextEntry(trans, nextblockindex, &tentry, &count)) {
+       afs_int32 nextblockindex = 0, count = 0, k = 0, match = 0;
+       while ((nextblockindex =
+              NextEntry(trans, nextblockindex, &tentry, &count))) {
            if (++pollcount > 50) {
+#ifndef AFS_PTHREAD_ENV
                IOMGR_Poll();
+#endif
                pollcount = 0;
            }
            match = 0;
            if (attributes->Mask & VLLIST_SERVER) {
                int serverindex;
                if ((serverindex =
-                    IpAddrToRelAddr(attributes->server,
-                                    (struct ubik_trans *)0)) == -1)
+                    IpAddrToRelAddr(attributes->server, NULL)) == -1)
                    continue;
                for (k = 0; k < OMAXNSERVERS; k++) {
                    if (tentry.serverNumber[k] == BADSERVERID)
@@ -1185,10 +1182,10 @@ SVL_ListAttributes(rxcall, attributes, nentries, vldbentries)
                if (!(tentry.flags & attributes->flag))
                    continue;
            }
-           if (errorcode =
+           if ((errorcode =
                put_attributeentry(&Vldbentry, &VldbentryFirst,
                                   &VldbentryLast, vldbentries, &tentry,
-                                  nentries, &allocCount)) {
+                                  nentries, &allocCount))) {
                COUNT_ABO;
                ubik_AbortTrans(trans);
                if (vldbentries->bulkentries_val)
@@ -1219,11 +1216,10 @@ SVL_ListAttributes(rxcall, attributes, nentries, vldbentries)
 }
 
 afs_int32
-SVL_ListAttributesN(rxcall, attributes, nentries, vldbentries)
-     struct rx_call *rxcall;
-     struct VldbListByAttributes *attributes;
-     afs_int32 *nentries;
-     nbulkentries *vldbentries;
+SVL_ListAttributesN(struct rx_call *rxcall,
+                   struct VldbListByAttributes *attributes,
+                   afs_int32 *nentries,
+                   nbulkentries *vldbentries)
 {
     int errorcode, allocCount = 0;
     struct ubik_trans *trans;
@@ -1234,7 +1230,7 @@ SVL_ListAttributesN(rxcall, attributes, nentries, vldbentries)
     COUNT_REQ(VLLISTATTRIBUTESN);
     vldbentries->nbulkentries_val = 0;
     vldbentries->nbulkentries_len = *nentries = 0;
-    if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKREAD, this_op)))
        return errorcode;
     allocCount = VLDBALLOCCOUNT;
     Vldbentry = VldbentryFirst = vldbentries->nbulkentries_val =
@@ -1245,7 +1241,8 @@ SVL_ListAttributesN(rxcall, attributes, nentries, vldbentries)
        return VL_NOMEM;
     }
     VldbentryLast = VldbentryFirst + allocCount;
-    /* Handle the attribute by volume id totally separate of the rest (thus additional Mask values are ignored if VLLIST_VOLUMEID is set!) */
+    /* Handle the attribute by volume id totally separate of the rest
+     * (thus additional Mask values are ignored if VLLIST_VOLUMEID is set!) */
     if (attributes->Mask & VLLIST_VOLUMEID) {
        afs_int32 blockindex;
 
@@ -1262,10 +1259,10 @@ SVL_ListAttributesN(rxcall, attributes, nentries, vldbentries)
            vldbentries->nbulkentries_len = 0;
            return errorcode;
        }
-       if (errorcode =
+       if ((errorcode =
            put_nattributeentry(&Vldbentry, &VldbentryFirst, &VldbentryLast,
                                vldbentries, &tentry, 0, 0, nentries,
-                               &allocCount)) {
+                               &allocCount))) {
            COUNT_ABO;
            ubik_AbortTrans(trans);
            if (vldbentries->nbulkentries_val)
@@ -1275,11 +1272,13 @@ SVL_ListAttributesN(rxcall, attributes, nentries, vldbentries)
            return VL_SIZEEXCEEDED;
        }
     } else {
-       afs_int32 nextblockindex = 0, count = 0, k, match = 0;
-       while (nextblockindex =
-              NextEntry(trans, nextblockindex, &tentry, &count)) {
+       afs_int32 nextblockindex = 0, count = 0, k = 0, match = 0;
+       while ((nextblockindex =
+              NextEntry(trans, nextblockindex, &tentry, &count))) {
            if (++pollcount > 50) {
+#ifndef AFS_PTHREAD_ENV
                IOMGR_Poll();
+#endif
                pollcount = 0;
            }
 
@@ -1287,8 +1286,7 @@ SVL_ListAttributesN(rxcall, attributes, nentries, vldbentries)
            if (attributes->Mask & VLLIST_SERVER) {
                int serverindex;
                if ((serverindex =
-                    IpAddrToRelAddr(attributes->server,
-                                    (struct ubik_trans *)0)) == -1)
+                    IpAddrToRelAddr(attributes->server, NULL)) == -1)
                    continue;
                for (k = 0; k < NMAXNSERVERS; k++) {
                    if (tentry.serverNumber[k] == BADSERVERID)
@@ -1324,10 +1322,10 @@ SVL_ListAttributesN(rxcall, attributes, nentries, vldbentries)
                if (!(tentry.flags & attributes->flag))
                    continue;
            }
-           if (errorcode =
+           if ((errorcode =
                put_nattributeentry(&Vldbentry, &VldbentryFirst,
                                    &VldbentryLast, vldbentries, &tentry, 0,
-                                   0, nentries, &allocCount)) {
+                                   0, nentries, &allocCount))) {
                COUNT_ABO;
                ubik_AbortTrans(trans);
                if (vldbentries->nbulkentries_val)
@@ -1359,30 +1357,31 @@ SVL_ListAttributesN(rxcall, attributes, nentries, vldbentries)
 
 
 afs_int32
-SVL_ListAttributesN2(rxcall, attributes, name, startindex, nentries,
-                    vldbentries, nextstartindex)
-     struct rx_call *rxcall;
-     struct VldbListByAttributes *attributes;
-     char *name;               /* Wildcarded volume name */
-     afs_int32 startindex;
-     afs_int32 *nentries;
-     nbulkentries *vldbentries;
-     afs_int32 *nextstartindex;
+SVL_ListAttributesN2(struct rx_call *rxcall,
+                    struct VldbListByAttributes *attributes,
+                    char *name,                /* Wildcarded volume name */
+                    afs_int32 startindex,
+                    afs_int32 *nentries,
+                    nbulkentries *vldbentries,
+                    afs_int32 *nextstartindex)
 {
     int errorcode = 0, maxCount = VLDBALLOCCOUNT;
     struct ubik_trans *trans;
     struct nvlentry tentry;
     struct nvldbentry *Vldbentry = 0, *VldbentryFirst = 0, *VldbentryLast = 0;
-    afs_int32 blockindex = 0, count = 0, k, match, matchindex;
+    afs_int32 blockindex = 0, count = 0, k, match;
+    afs_int32 matchindex = 0;
     int serverindex = -1;      /* no server found */
     int findserver = 0, findpartition = 0, findflag = 0, findname = 0;
-    char *t;
     int pollcount = 0;
-    int namematchRWBK, namematchRO, thismatch, matchtype;
+    int namematchRWBK, namematchRO, thismatch;
+    int matchtype = 0;
     char volumename[VL_MAXNAMELEN];
 #ifdef HAVE_POSIX_REGEX
     regex_t re;
     int need_regfree = 0;
+#else
+    char *t;
 #endif
 
     COUNT_REQ(VLLISTATTRIBUTESN2);
@@ -1432,7 +1431,7 @@ SVL_ListAttributesN2(rxcall, attributes, name, startindex, nentries,
        /* Get the server index for matching server address */
        if (attributes->Mask & VLLIST_SERVER) {
            serverindex =
-               IpAddrToRelAddr(attributes->server, (struct ubik_trans *)0);
+               IpAddrToRelAddr(attributes->server, NULL);
            if (serverindex == -1)
                goto done;
            findserver = 1;
@@ -1459,9 +1458,11 @@ SVL_ListAttributesN2(rxcall, attributes, name, startindex, nentries,
 
        /* Read each entry and see if it is the one we want */
        blockindex = startindex;
-       while (blockindex = NextEntry(trans, blockindex, &tentry, &count)) {
+       while ((blockindex = NextEntry(trans, blockindex, &tentry, &count))) {
            if (++pollcount > 50) {
+#ifndef AFS_PTHREAD_ENV
                IOMGR_Poll();
+#endif
                pollcount = 0;
            }
 
@@ -1630,22 +1631,22 @@ SVL_ListAttributesN2(rxcall, attributes, name, startindex, nentries,
  * cases sequential search of all vldb entries is performed.
  */
 afs_int32
-SVL_LinkedList(rxcall, attributes, nentries, vldbentries)
-     struct rx_call *rxcall;
-     struct VldbListByAttributes *attributes;
-     afs_int32 *nentries;
-     vldb_list *vldbentries;
+SVL_LinkedList(struct rx_call *rxcall,
+              struct VldbListByAttributes *attributes,
+              afs_int32 *nentries,
+              vldb_list *vldbentries)
 {
     int errorcode;
     struct ubik_trans *trans;
     struct nvlentry tentry;
     vldblist vllist, *vllistptr;
-    afs_int32 blockindex, count, k, match;
+    afs_int32 blockindex, count, match;
+    afs_int32 k = 0;
     int serverindex;
     int pollcount = 0;
 
     COUNT_REQ(VLLINKEDLIST);
-    if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKREAD, this_op)))
        return errorcode;
 
     *nentries = 0;
@@ -1683,15 +1684,16 @@ SVL_LinkedList(rxcall, attributes, nentries, vldbentries)
            match = 0;
 
            if (++pollcount > 50) {
+#ifndef AFS_PTHREAD_ENV
                IOMGR_Poll();
+#endif
                pollcount = 0;
            }
 
            /* Does this volume exist on the desired server */
            if (attributes->Mask & VLLIST_SERVER) {
                serverindex =
-                   IpAddrToRelAddr(attributes->server,
-                                   (struct ubik_trans *)0);
+                   IpAddrToRelAddr(attributes->server, NULL);
                if (serverindex == -1)
                    continue;
                for (k = 0; k < OMAXNSERVERS; k++) {
@@ -1756,22 +1758,22 @@ SVL_LinkedList(rxcall, attributes, nentries, vldbentries)
 }
 
 afs_int32
-SVL_LinkedListN(rxcall, attributes, nentries, vldbentries)
-     struct rx_call *rxcall;
-     struct VldbListByAttributes *attributes;
-     afs_int32 *nentries;
-     nvldb_list *vldbentries;
+SVL_LinkedListN(struct rx_call *rxcall,
+               struct VldbListByAttributes *attributes,
+               afs_int32 *nentries,
+               nvldb_list *vldbentries)
 {
     int errorcode;
     struct ubik_trans *trans;
     struct nvlentry tentry;
     nvldblist vllist, *vllistptr;
-    afs_int32 blockindex, count, k, match;
+    afs_int32 blockindex, count, match;
+    afs_int32 k = 0;
     int serverindex;
     int pollcount = 0;
 
     COUNT_REQ(VLLINKEDLISTN);
-    if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKREAD, this_op)))
        return errorcode;
 
     *nentries = 0;
@@ -1809,15 +1811,16 @@ SVL_LinkedListN(rxcall, attributes, nentries, vldbentries)
            match = 0;
 
            if (++pollcount > 50) {
+#ifndef AFS_PTHREAD_ENV
                IOMGR_Poll();
+#endif
                pollcount = 0;
            }
 
            /* Does this volume exist on the desired server */
            if (attributes->Mask & VLLIST_SERVER) {
                serverindex =
-                   IpAddrToRelAddr(attributes->server,
-                                   (struct ubik_trans *)0);
+                   IpAddrToRelAddr(attributes->server, NULL);
                if (serverindex == -1)
                    continue;
                for (k = 0; k < NMAXNSERVERS; k++) {
@@ -1881,12 +1884,14 @@ SVL_LinkedListN(rxcall, attributes, nentries, vldbentries)
     return (ubik_EndTrans(trans));
 }
 
-/* Get back vldb header statistics (allocs, frees, maxvolumeid, totalentries, etc) and dynamic statistics (number of requests and/or aborts per remote procedure call, etc) */
+/* Get back vldb header statistics (allocs, frees, maxvolumeid,
+ * totalentries, etc) and dynamic statistics (number of requests and/or
+ * aborts per remote procedure call, etc)
+ */
 afs_int32
-SVL_GetStats(rxcall, stats, vital_header)
-     struct rx_call *rxcall;
-     vldstats *stats;
-     vital_vlheader *vital_header;
+SVL_GetStats(struct rx_call *rxcall,
+            vldstats *stats,
+            vital_vlheader *vital_header)
 {
     register afs_int32 errorcode;
     struct ubik_trans *trans;
@@ -1897,7 +1902,7 @@ SVL_GetStats(rxcall, stats, vital_header)
     if (!afsconf_SuperUser(vldb_confdir, rxcall, NULL))        /* Must be in 'UserList' to use */
        return VL_PERM;
 #endif
-    if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKREAD, this_op)))
        return errorcode;
     VLog(5, ("GetStats %s\n", rxinfo(rxcall)));
     memcpy((char *)vital_header, (char *)&cheader.vital_header,
@@ -1911,12 +1916,12 @@ SVL_GetStats(rxcall, stats, vital_header)
  * through the VLDB, but that's life.
  */
 afs_int32
-SVL_GetAddrs(rxcall, Handle, spare2, spare3, nentries, addrsp)
-     struct rx_call *rxcall;
-     afs_int32 Handle, spare2;
-     struct VLCallBack *spare3;
-     afs_int32 *nentries;
-     bulkaddrs *addrsp;
+SVL_GetAddrs(struct rx_call *rxcall,
+            afs_int32 Handle,
+            afs_int32 spare2,
+            struct VLCallBack *spare3,
+            afs_int32 *nentries,
+            bulkaddrs *addrsp)
 {
     register afs_int32 errorcode;
     struct ubik_trans *trans;
@@ -1928,7 +1933,7 @@ SVL_GetAddrs(rxcall, Handle, spare2, spare3, nentries, addrsp)
     addrsp->bulkaddrs_val = 0;
     memset(spare3, 0, sizeof(struct VLCallBack));
 
-    if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKREAD, this_op)))
        return errorcode;
 
     VLog(5, ("GetAddrs\n"));
@@ -1943,7 +1948,7 @@ SVL_GetAddrs(rxcall, Handle, spare2, spare3, nentries, addrsp)
     }
 
     for (i = 0; i <= MAXSERVERID; i++) {
-       if (*taddrp = ntohl(cheader.IpMappedAddr[i])) {
+       if ((*taddrp = ntohl(cheader.IpMappedAddr[i]))) {
            taddrp++;
            nservers++;
        }
@@ -1956,11 +1961,8 @@ SVL_GetAddrs(rxcall, Handle, spare2, spare3, nentries, addrsp)
 #define PADDR(addr) VLog(0,("%d.%d.%d.%d", (addr>>24)&0xff, (addr>>16)&0xff, (addr>>8) &0xff, addr&0xff));
 
 afs_int32
-SVL_RegisterAddrs(rxcall, uuidp, spare1, addrsp)
-     struct rx_call *rxcall;
-     afsUUID *uuidp;
-     afs_int32 spare1;
-     bulkaddrs *addrsp;
+SVL_RegisterAddrs(struct rx_call *rxcall, afsUUID *uuidp, afs_int32 spare1,
+                 bulkaddrs *addrsp)
 {
     afs_int32 code;
     struct ubik_trans *trans;
@@ -1970,14 +1972,15 @@ SVL_RegisterAddrs(rxcall, uuidp, spare1, addrsp)
     afs_uint32 addrs[VL_MAXIPADDRS_PERMH];
     afs_int32 fbase;
     int count, willChangeEntry, foundUuidEntry, willReplaceCnt;
-    int WillReplaceEntry, WillChange[MAXSERVERID + 1], FoundUuid,
-       ReplaceEntry;
+    int WillReplaceEntry, WillChange[MAXSERVERID + 1];
+    int FoundUuid = 0;
+    int ReplaceEntry = 0;
     int srvidx, mhidx;
 
     COUNT_REQ(VLREGADDR);
     if (!afsconf_SuperUser(vldb_confdir, rxcall, NULL))
        return (VL_PERM);
-    if (code = Init_VLdbase(&trans, LOCKWRITE, this_op))
+    if ((code = Init_VLdbase(&trans, LOCKWRITE, this_op)))
        return code;
 
     /* Eliminate duplicates from IP address list */
@@ -2333,12 +2336,12 @@ SVL_RegisterAddrs(rxcall, uuidp, spare1, addrsp)
 }
 
 afs_int32
-SVL_GetAddrsU(rxcall, attributes, uuidpo, uniquifier, nentries, addrsp)
-     struct rx_call *rxcall;
-     struct ListAddrByAttributes *attributes;
-     afsUUID *uuidpo;
-     afs_int32 *uniquifier, *nentries;
-     bulkaddrs *addrsp;
+SVL_GetAddrsU(struct rx_call *rxcall,
+             struct ListAddrByAttributes *attributes,
+             afsUUID *uuidpo,
+             afs_int32 *uniquifier,
+             afs_int32 *nentries,
+             bulkaddrs *addrsp)
 {
     register afs_int32 errorcode, index = -1, offset;
     struct ubik_trans *trans;
@@ -2351,7 +2354,7 @@ SVL_GetAddrsU(rxcall, attributes, uuidpo, uniquifier, nentries, addrsp)
     addrsp->bulkaddrs_len = *nentries = 0;
     addrsp->bulkaddrs_val = 0;
     VLog(5, ("GetAddrsU %s\n", rxinfo(rxcall)));
-    if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
+    if ((errorcode = Init_VLdbase(&trans, LOCKREAD, this_op)))
        return errorcode;
 
     if (attributes->Mask & VLADDR_IPADDR) {
@@ -2414,8 +2417,8 @@ SVL_GetAddrsU(rxcall, attributes, uuidpo, uniquifier, nentries, addrsp)
            ubik_AbortTrans(trans);
            return VL_NOENT;
        }
-       if (errorcode =
-           FindExtentBlock(trans, &attributes->uuid, 0, -1, &exp, &base)) {
+       if ((errorcode =
+           FindExtentBlock(trans, &attributes->uuid, 0, -1, &exp, &base))) {
            ubik_AbortTrans(trans);
            return errorcode;
        }
@@ -2469,12 +2472,13 @@ SVL_GetAddrsU(rxcall, attributes, uuidpo, uniquifier, nentries, addrsp)
 
 /* Routine that copies the given vldb entry to the output buffer, vldbentries. */
 static int
-put_attributeentry(Vldbentry, VldbentryFirst, VldbentryLast, vldbentries,
-                  entry, nentries, alloccnt)
-     struct vldbentry **Vldbentry, **VldbentryFirst, **VldbentryLast;
-     bulkentries *vldbentries;
-     struct nvlentry *entry;
-     afs_int32 *nentries, *alloccnt;
+put_attributeentry(struct vldbentry **Vldbentry,
+                  struct vldbentry **VldbentryFirst,
+                  struct vldbentry **VldbentryLast,
+                  bulkentries *vldbentries,
+                  struct nvlentry *entry,
+                  afs_int32 *nentries,
+                  afs_int32 *alloccnt)
 {
     vldbentry *reall;
     afs_int32 allo;
@@ -2507,12 +2511,15 @@ put_attributeentry(Vldbentry, VldbentryFirst, VldbentryLast, vldbentries,
 }
 
 static int
-put_nattributeentry(Vldbentry, VldbentryFirst, VldbentryLast, vldbentries,
-                   entry, matchtype, matchindex, nentries, alloccnt)
-     struct nvldbentry **Vldbentry, **VldbentryFirst, **VldbentryLast;
-     nbulkentries *vldbentries;
-     struct nvlentry *entry;
-     afs_int32 matchtype, matchindex, *nentries, *alloccnt;
+put_nattributeentry(struct nvldbentry **Vldbentry,
+                   struct nvldbentry **VldbentryFirst,
+                   struct nvldbentry **VldbentryLast,
+                   nbulkentries *vldbentries,
+                   struct nvlentry *entry,
+                   afs_int32 matchtype,
+                   afs_int32 matchindex,
+                   afs_int32 *nentries,
+                   afs_int32 *alloccnt)
 {
     nvldbentry *reall;
     afs_int32 allo;
@@ -2548,24 +2555,20 @@ put_nattributeentry(Vldbentry, VldbentryFirst, VldbentryLast, vldbentries,
 
 /* Common code to actually remove a vldb entry from the database. */
 static int
-RemoveEntry(trans, entryptr, tentry)
-     struct ubik_trans *trans;
-     afs_int32 entryptr;
-     struct nvlentry *tentry;
+RemoveEntry(struct ubik_trans *trans, afs_int32 entryptr,
+           struct nvlentry *tentry)
 {
     register int errorcode;
 
-    if (errorcode = UnthreadVLentry(trans, entryptr, tentry))
+    if ((errorcode = UnthreadVLentry(trans, entryptr, tentry)))
        return errorcode;
-    if (errorcode = FreeBlock(trans, entryptr))
+    if ((errorcode = FreeBlock(trans, entryptr)))
        return errorcode;
     return 0;
 }
 
-static
-ReleaseEntry(tentry, releasetype)
-     struct nvlentry *tentry;
-     afs_int32 releasetype;
+static void
+ReleaseEntry(struct nvlentry *tentry, afs_int32 releasetype)
 {
     if (releasetype & LOCKREL_TIMESTAMP)
        tentry->LockTimestamp = 0;
@@ -2576,10 +2579,10 @@ ReleaseEntry(tentry, releasetype)
 }
 
 
-/* Verify that the incoming vldb entry is valid; multi type of error codes are returned. */
+/* Verify that the incoming vldb entry is valid; multi type of error codes
+ * are returned. */
 static int
-check_vldbentry(aentry)
-     struct vldbentry *aentry;
+check_vldbentry(struct vldbentry *aentry)
 {
     afs_int32 i;
 
@@ -2601,8 +2604,7 @@ check_vldbentry(aentry)
 }
 
 static int
-check_nvldbentry(aentry)
-     struct nvldbentry *aentry;
+check_nvldbentry(struct nvldbentry *aentry)
 {
     afs_int32 i;
 
@@ -2627,10 +2629,9 @@ check_nvldbentry(aentry)
 /* Convert from the external vldb entry representation to its internal
    (more compact) form.  This call should not change the hash chains! */
 static int
-vldbentry_to_vlentry(atrans, VldbEntry, VlEntry)
-     struct ubik_trans *atrans;
-     struct vldbentry *VldbEntry;
-     struct nvlentry *VlEntry;
+vldbentry_to_vlentry(struct ubik_trans *atrans,
+                    struct vldbentry *VldbEntry,
+                    struct nvlentry *VlEntry)
 {
     int i, serverindex;
 
@@ -2655,10 +2656,9 @@ vldbentry_to_vlentry(atrans, VldbEntry, VlEntry)
 }
 
 static int
-nvldbentry_to_vlentry(atrans, VldbEntry, VlEntry)
-     struct ubik_trans *atrans;
-     struct nvldbentry *VldbEntry;
-     struct nvlentry *VlEntry;
+nvldbentry_to_vlentry(struct ubik_trans *atrans,
+                     struct nvldbentry *VldbEntry,
+                     struct nvlentry *VlEntry)
 {
     int i, serverindex;
 
@@ -2683,27 +2683,29 @@ nvldbentry_to_vlentry(atrans, VldbEntry, VlEntry)
 }
 
 
-/* Update the vldb entry with the new fields as indicated by the value of the Mask entry in the updateentry structure. All necessary validation checks are performed. */
-static
-get_vldbupdateentry(trans, blockindex, updateentry, VlEntry)
-     struct ubik_trans *trans;
-     afs_int32 blockindex;
-     struct VldbUpdateEntry *updateentry;
-     struct nvlentry *VlEntry;
+/* Update the vldb entry with the new fields as indicated by the value of
+ * the Mask entry in the updateentry structure. All necessary validation
+ * checks are performed.
+ */
+static int
+get_vldbupdateentry(struct ubik_trans *trans,
+                   afs_int32 blockindex,
+                   struct VldbUpdateEntry *updateentry,
+                   struct nvlentry *VlEntry)
 {
     int i, j, errorcode, serverindex;
 
     if (updateentry->Mask & VLUPDATE_VOLUMENAME) {
        if (InvalidVolname(updateentry->name))
            return VL_BADNAME;
-       if (errorcode = UnhashVolname(trans, blockindex, VlEntry))
+       if ((errorcode = UnhashVolname(trans, blockindex, VlEntry)))
            return errorcode;
        strncpy(VlEntry->name, updateentry->name, sizeof(VlEntry->name));
        HashVolname(trans, blockindex, VlEntry);
     }
 
     if (updateentry->Mask & VLUPDATE_VOLNAMEHASH) {
-       if (errorcode = UnhashVolname(trans, blockindex, VlEntry)) {
+       if ((errorcode = UnhashVolname(trans, blockindex, VlEntry))) {
            if (errorcode != VL_NOENT)
                return errorcode;
        }
@@ -2717,30 +2719,30 @@ get_vldbupdateentry(trans, blockindex, updateentry, VlEntry)
        VlEntry->cloneId = updateentry->cloneId;
     }
     if (updateentry->Mask & VLUPDATE_RWID) {
-       if (errorcode = UnhashVolid(trans, RWVOL, blockindex, VlEntry)) {
+       if ((errorcode = UnhashVolid(trans, RWVOL, blockindex, VlEntry))) {
            if (errorcode != VL_NOENT)
                return errorcode;
        }
        VlEntry->volumeId[RWVOL] = updateentry->spares3;        /* rw id */
-       if (errorcode = HashVolid(trans, RWVOL, blockindex, VlEntry))
+       if ((errorcode = HashVolid(trans, RWVOL, blockindex, VlEntry)))
            return errorcode;
     }
     if (updateentry->Mask & VLUPDATE_READONLYID) {
-       if (errorcode = UnhashVolid(trans, ROVOL, blockindex, VlEntry)) {
+       if ((errorcode = UnhashVolid(trans, ROVOL, blockindex, VlEntry))) {
            if (errorcode != VL_NOENT)
                return errorcode;
        }
        VlEntry->volumeId[ROVOL] = updateentry->ReadOnlyId;
-       if (errorcode = HashVolid(trans, ROVOL, blockindex, VlEntry))
+       if ((errorcode = HashVolid(trans, ROVOL, blockindex, VlEntry)))
            return errorcode;
     }
     if (updateentry->Mask & VLUPDATE_BACKUPID) {
-       if (errorcode = UnhashVolid(trans, BACKVOL, blockindex, VlEntry)) {
+       if ((errorcode = UnhashVolid(trans, BACKVOL, blockindex, VlEntry))) {
            if (errorcode != VL_NOENT)
                return errorcode;
        }
        VlEntry->volumeId[BACKVOL] = updateentry->BackupId;
-       if (errorcode = HashVolid(trans, BACKVOL, blockindex, VlEntry))
+       if ((errorcode = HashVolid(trans, BACKVOL, blockindex, VlEntry)))
            return errorcode;
     }
     if (updateentry->Mask & VLUPDATE_REPSITES) {
@@ -2847,11 +2849,11 @@ get_vldbupdateentry(trans, blockindex, updateentry, VlEntry)
 }
 
 
-/* Check if the specified [server,partition] entry is found in the vldb entry's repsite table; it's offset in the table is returned, if it's present there. */
+/* Check if the specified [server,partition] entry is found in the vldb
+ * entry's repsite table; it's offset in the table is returned, if it's
+ * present there. */
 static int
-repsite_exists(VlEntry, server, partition)
-     struct nvlentry *VlEntry;
-     int server, partition;
+repsite_exists(struct nvlentry *VlEntry, int server, int partition)
 {
     int i;
 
@@ -2866,11 +2868,10 @@ repsite_exists(VlEntry, server, partition)
 
 
 
-/* Repsite table compression: used when deleting a repsite entry so that all active repsite entries are on the top of the table. */
-static
-repsite_compress(VlEntry, offset)
-     struct nvlentry *VlEntry;
-     int offset;
+/* Repsite table compression: used when deleting a repsite entry so that
+ * all active repsite entries are on the top of the table. */
+static void
+repsite_compress(struct nvlentry *VlEntry, int offset)
 {
     int repsite_offset = offset;
     for (;
@@ -2887,11 +2888,10 @@ repsite_compress(VlEntry, offset)
 }
 
 
-/* Convert from the internal (compacted) vldb entry to the external representation used by the interface. */
-static
-vlentry_to_vldbentry(VlEntry, VldbEntry)
-     struct nvlentry *VlEntry;
-     struct vldbentry *VldbEntry;
+/* Convert from the internal (compacted) vldb entry to the external
+ * representation used by the interface. */
+static void
+vlentry_to_vldbentry(struct nvlentry *VlEntry, struct vldbentry *VldbEntry)
 {
     int i, j;
 
@@ -2929,11 +2929,10 @@ vlentry_to_vldbentry(VlEntry, VldbEntry)
 }
 
 
-/* Convert from the internal (compacted) vldb entry to the external representation used by the interface. */
-static
-vlentry_to_nvldbentry(VlEntry, VldbEntry)
-     struct nvlentry *VlEntry;
-     struct nvldbentry *VldbEntry;
+/* Convert from the internal (compacted) vldb entry to the external
+ * representation used by the interface. */
+static void
+vlentry_to_nvldbentry(struct nvlentry *VlEntry, struct nvldbentry *VldbEntry)
 {
     int i, j;
 
@@ -2970,10 +2969,8 @@ vlentry_to_nvldbentry(VlEntry, VldbEntry)
     VldbEntry->flags = VlEntry->flags;
 }
 
-static
-vlentry_to_uvldbentry(VlEntry, VldbEntry)
-     struct nvlentry *VlEntry;
-     struct uvldbentry *VldbEntry;
+static void
+vlentry_to_uvldbentry(struct nvlentry *VlEntry, struct uvldbentry *VldbEntry)
 {
     int i, j;
 
@@ -3017,8 +3014,7 @@ vlentry_to_uvldbentry(VlEntry, VldbEntry)
 
 /* Verify that the volname is a valid volume name. */
 static int
-InvalidVolname(volname)
-     char *volname;
+InvalidVolname(char *volname)
 {
     char *map;
     int slen;
@@ -3033,8 +3029,7 @@ InvalidVolname(volname)
 
 /* Verify that the given volume type is valid. */
 static int
-InvalidVoltype(voltype)
-     afs_int32 voltype;
+InvalidVoltype(afs_int32 voltype)
 {
     if (voltype != RWVOL && voltype != ROVOL && voltype != BACKVOL)
        return 1;
@@ -3043,8 +3038,7 @@ InvalidVoltype(voltype)
 
 
 static int
-InvalidOperation(voloper)
-     afs_int32 voloper;
+InvalidOperation(afs_int32 voloper)
 {
     if (voloper != VLOP_MOVE && voloper != VLOP_RELEASE
        && voloper != VLOP_BACKUP && voloper != VLOP_DELETE
@@ -3054,8 +3048,7 @@ InvalidOperation(voloper)
 }
 
 static int
-InvalidReleasetype(releasetype)
-     afs_int32 releasetype;
+InvalidReleasetype(afs_int32 releasetype)
 {
     if ((releasetype & LOCKREL_TIMESTAMP) || (releasetype & LOCKREL_OPCODE)
        || (releasetype & LOCKREL_AFSID))
@@ -3064,9 +3057,7 @@ InvalidReleasetype(releasetype)
 }
 
 static int
-IpAddrToRelAddr(ipaddr, atrans)
-     struct ubik_trans *atrans;
-     register afs_uint32 ipaddr;
+IpAddrToRelAddr(register afs_uint32 ipaddr, struct ubik_trans *atrans)
 {
     register int i, j;
     register afs_int32 code, base, index;
@@ -3126,14 +3117,13 @@ IpAddrToRelAddr(ipaddr, atrans)
 }
 
 static int
-ChangeIPAddr(ipaddr1, ipaddr2, atrans)
-     struct ubik_trans *atrans;
-     register afs_uint32 ipaddr1, ipaddr2;
+ChangeIPAddr(afs_uint32 ipaddr1, afs_uint32 ipaddr2, struct ubik_trans *atrans)
 {
     int i, j;
     afs_int32 code;
-    struct extentaddr *exp;
-    int base, index, mhidx;
+    struct extentaddr *exp = NULL;
+    int base = 0;
+    int index, mhidx;
     afsUUID tuuid;
     afs_int32 blockindex, count;
     int pollcount = 0;
@@ -3196,7 +3186,9 @@ ChangeIPAddr(ipaddr1, ipaddr2, atrans)
        for (blockindex = NextEntry(atrans, 0, &tentry, &count); blockindex;
             blockindex = NextEntry(atrans, blockindex, &tentry, &count)) {
            if (++pollcount > 50) {
+#ifndef AFS_PTHREAD_ENV
                IOMGR_Poll();
+#endif
                pollcount = 0;
            }
            for (j = 0; j < NMAXNSERVERS; j++) {
@@ -3262,8 +3254,7 @@ ChangeIPAddr(ipaddr1, ipaddr2, atrans)
 
 /* see if the vlserver is back yet */
 afs_int32
-SVL_ProbeServer(rxcall)
-     struct rx_call *rxcall;
+SVL_ProbeServer(struct rx_call *rxcall)
 {
     return 0;
 }