OPENAFS-SA-2016-002 VldbListByAttributes information leak
[openafs.git] / src / libadmin / vos / afs_vosAdmin.c
index 9a17725..49db8cb 100644 (file)
@@ -9,44 +9,38 @@
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/stds.h>
 
-RCSID("$Header$");
+#include <roken.h>
 
-#include <afs/stds.h>
-#include <stdio.h>
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
 #include <ctype.h>
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#include <io.h>
-#else
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <unistd.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <netdb.h>
-#endif
-#include "afs_vosAdmin.h"
-#include "../adminutil/afs_AdminInternal.h"
-#include <afs/afs_utilAdmin.h>
+
 #include <afs/vlserver.h>
+#include <afs/afsint.h>
 #include <afs/volser.h>
 #include <afs/volint.h>
+
+#include "afs_vosAdmin.h"
+#include "../adminutil/afs_AdminInternal.h"
+
+/* File descriptors are HANDLE's on NT. The following typedef helps catch
+ * type errors. Duplicated from vol/ihandle.h
+ */
+#ifdef AFS_NT40_ENV
+typedef HANDLE FD_t;
+#else
+typedef int FD_t;
+#endif
+#define INVALID_FD ((FD_t)-1)
+
 #include <afs/partition.h>
 #include <rx/rx.h>
+#include <rx/rxstat.h>
+#include <afs/afs_utilAdmin.h>
 #include "vosutils.h"
 #include "vsprocs.h"
 #include "lockprocs.h"
 
-extern int VL_GetAddrsU();
-
 typedef struct file_server {
     int begin_magic;
     int is_valid;
@@ -70,34 +64,33 @@ typedef struct file_server {
  * Returns != 0 upon successful completion.
  */
 
-static int IsValidServerHandle(
-    file_server_p serverHandle,
-    afs_status_p st)
+static int
+IsValidServerHandle(file_server_p serverHandle, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
 
     if (serverHandle == NULL) {
-        tst = ADMVOSSERVERHANDLENULL;
-        goto fail_IsValidServerHandle;
+       tst = ADMVOSSERVERHANDLENULL;
+       goto fail_IsValidServerHandle;
     }
 
     if (serverHandle->is_valid != 1) {
-        tst = ADMVOSSERVERHANDLEINVALID;
-        goto fail_IsValidServerHandle;
+       tst = ADMVOSSERVERHANDLEINVALID;
+       goto fail_IsValidServerHandle;
     }
 
-    if ((serverHandle->begin_magic != BEGIN_MAGIC) ||
-        (serverHandle->end_magic != END_MAGIC)) {
-        tst = ADMVOSSERVERHANDLEBADMAGIC;
-        goto fail_IsValidServerHandle;
+    if ((serverHandle->begin_magic != BEGIN_MAGIC)
+       || (serverHandle->end_magic != END_MAGIC)) {
+       tst = ADMVOSSERVERHANDLEBADMAGIC;
+       goto fail_IsValidServerHandle;
     }
     rc = 1;
 
-fail_IsValidServerHandle:
+  fail_IsValidServerHandle:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
 
     return rc;
@@ -120,14 +113,13 @@ fail_IsValidServerHandle:
  * Returns != 0 upon successful completion.
  */
 
-static int IsValidCellHandle(
-  afs_cell_handle_p cellHandle,
-  afs_status_p st)
+static int
+IsValidCellHandle(afs_cell_handle_p cellHandle, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
 
-    if (!CellHandleIsValid((void *) cellHandle, &tst)) {
+    if (!CellHandleIsValid((void *)cellHandle, &tst)) {
        goto fail_IsValidCellHandle;
     }
 
@@ -137,7 +129,7 @@ static int IsValidCellHandle(
     }
     rc = 1;
 
-fail_IsValidCellHandle:
+  fail_IsValidCellHandle:
 
     if (st != NULL) {
        *st = tst;
@@ -147,37 +139,34 @@ fail_IsValidCellHandle:
 
 /* set <server> and <part> to the correct values depending on
  * <voltype> and <entry> */
-static void GetServerAndPart (
-  struct nvldbentry *entry,
-  int voltype,
-  afs_int32 *server,
-  afs_int32 *part,
-  int *previdx)
+static void
+GetServerAndPart(struct nvldbentry *entry, int voltype, afs_int32 * server,
+                afs_int32 * part, int *previdx)
 {
     int i, istart, vtype;
+
     *server = -1;
-    *part   = -1;
+    *part = -1;
+
     /* Doesn't check for non-existance of backup volume */
     if ((voltype == RWVOL) || (voltype == BACKVOL)) {
-       vtype = ITSRWVOL;
-       istart = 0;      /* seach the entire entry */
+       vtype = VLSF_RWVOL;
+       istart = 0;             /* seach the entire entry */
     } else {
-       vtype = ITSROVOL;
-       /* Seach from beginning of entry or pick up where we left off */
-       istart = ((*previdx < 0) ? 0 : *previdx+1);
+       vtype = VLSF_ROVOL;
+       /* Seach from beginning of entry or pick up where we left off */
+       istart = ((*previdx < 0) ? 0 : *previdx + 1);
     }
+
     for (i = istart; i < entry->nServers; i++) {
-       if (entry->serverFlags[i] & vtype) {
-          *server = entry->serverNumber[i];
-          *part   = entry->serverPartition[i];
-          *previdx = i;
-          return;
-       }
-    }
+       if (entry->serverFlags[i] & vtype) {
+           *server = entry->serverNumber[i];
+           *part = entry->serverPartition[i];
+           *previdx = i;
+           return;
+       }
+    }
+
     /* Didn't find any, return -1 */
     *previdx = -1;
     return;
@@ -205,11 +194,9 @@ static void GetServerAndPart (
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_BackupVolumeCreate(
-  const void *cellHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int volumeId,
-  afs_status_p st)
+int ADMINAPI
+vos_BackupVolumeCreate(const void *cellHandle, vos_MessageCallBack_t callBack,
+                      unsigned int volumeId, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -223,7 +210,7 @@ int ADMINAPI vos_BackupVolumeCreate(
     afs_int32 bk_partition;
     afs_int32 bk_vol_type;
     int equal;
+
     /*
      * Validate arguments
      */
@@ -237,8 +224,9 @@ int ADMINAPI vos_BackupVolumeCreate(
      * a read write volume id
      */
 
-    if (!GetVolumeInfo(c_handle, volumeId, &rw_vol_entry, &rw_server,
-                      &rw_partition, &rw_vol_type, &tst)) {
+    if (!GetVolumeInfo
+       (c_handle, volumeId, &rw_vol_entry, &rw_server, &rw_partition,
+        &rw_vol_type, &tst)) {
        goto fail_vos_BackupVolumeCreate;
     }
 
@@ -252,10 +240,10 @@ int ADMINAPI vos_BackupVolumeCreate(
      * same server as volumeId
      */
 
-    if (rw_vol_entry.flags & BACK_EXISTS) {
-       if (!GetVolumeInfo(c_handle, rw_vol_entry.volumeId[BACKVOL],
-                          &bk_vol_entry, &bk_server, &bk_partition,
-                          &bk_vol_type, &tst)) {
+    if (rw_vol_entry.flags & VLF_BACKEXISTS) {
+       if (!GetVolumeInfo
+           (c_handle, rw_vol_entry.volumeId[BACKVOL], &bk_vol_entry,
+            &bk_server, &bk_partition, &bk_vol_type, &tst)) {
            goto fail_vos_BackupVolumeCreate;
        }
        if (!VLDB_IsSameAddrs(c_handle, bk_server, rw_server, &equal, &tst)) {
@@ -273,10 +261,10 @@ int ADMINAPI vos_BackupVolumeCreate(
 
     rc = UV_BackupVolume(c_handle, rw_server, rw_partition, volumeId, &tst);
 
-fail_vos_BackupVolumeCreate:
+  fail_vos_BackupVolumeCreate:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -312,14 +300,13 @@ fail_vos_BackupVolumeCreate:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_BackupVolumeCreateMultiple(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  const unsigned int *partition,
-  const char *volumePrefix,
-  vos_exclude_t excludePrefix,
-  afs_status_p st)
+int ADMINAPI
+vos_BackupVolumeCreateMultiple(const void *cellHandle,
+                              const void *serverHandle,
+                              vos_MessageCallBack_t callBack,
+                              const unsigned int *partition,
+                              const char *volumePrefix,
+                              vos_exclude_t excludePrefix, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -331,14 +318,15 @@ int ADMINAPI vos_BackupVolumeCreateMultiple(
     size_t prefix_len = 0;
     nbulkentries arrayEntries;
     afs_int32 nentries = 0;
-    register struct nvldbentry *entry;
+    struct nvldbentry *entry;
     int i;
     afs_int32 rw_volid, rw_server, rw_partition;
     int previdx;
     int equal = 0;
     char backbuf[1024];
-    memset((void *) &attr, 0, sizeof(attr));
+
+    memset(&attr, 0, sizeof(attr));
+    memset(&arrayEntries, 0, sizeof(arrayEntries));
 
     /*
      * Validate arguments
@@ -352,8 +340,8 @@ int ADMINAPI vos_BackupVolumeCreateMultiple(
        goto fail_vos_BackupVolumeCreateMultiple;
     }
 
-    if ((excludePrefix == VOS_EXCLUDE) &&
-       ((volumePrefix == NULL) || (*volumePrefix == 0))) {
+    if ((excludePrefix == VOS_EXCLUDE)
+       && ((volumePrefix == NULL) || (*volumePrefix == 0))) {
        tst = ADMVOSEXCLUDEREQUIRESPREFIX;
        goto fail_vos_BackupVolumeCreateMultiple;
     }
@@ -384,8 +372,6 @@ int ADMINAPI vos_BackupVolumeCreateMultiple(
        prefix_len = strlen(volumePrefix);
     }
 
-    memset((void *) &arrayEntries, 0, sizeof(arrayEntries));
-
     /*
      * Get a list of all the volumes in the cell
      */
@@ -399,20 +385,20 @@ int ADMINAPI vos_BackupVolumeCreateMultiple(
      * for each individual volume
      */
 
-    for(i=0;i<nentries;i++) {
+    for (i = 0; i < nentries; i++) {
        entry = &arrayEntries.nbulkentries_val[i];
 
        /*
         * Skip entries that don't have a RW volume
         */
 
-       if (!(entry->flags & RW_EXISTS)) {
+       if (!(entry->flags & VLF_RWEXISTS)) {
            if (callBack != NULL) {
                const char *messageText;
-               if (util_AdminErrorCodeTranslate(ADMVOSVOLUMENOREADWRITE, 0,
-                                                &messageText, &tst)) {
+               if (util_AdminErrorCodeTranslate
+                   (ADMVOSVOLUMENOREADWRITE, 0, &messageText, &tst)) {
                    sprintf(backbuf, "%s %s", messageText, entry->name);
-                   (**callBack)(VOS_VERBOSE_MESSAGE, backbuf);
+                   (**callBack) (VOS_VERBOSE_MESSAGE, backbuf);
                }
            }
            continue;
@@ -441,10 +427,10 @@ int ADMINAPI vos_BackupVolumeCreateMultiple(
        if ((rw_server == -1) || (rw_partition == -1)) {
            if (callBack != NULL) {
                const char *messageText;
-               if (util_AdminErrorCodeTranslate(ADMVOSVLDBBADENTRY, 0,
-                                                &messageText, &tst)) {
+               if (util_AdminErrorCodeTranslate
+                   (ADMVOSVLDBBADENTRY, 0, &messageText, &tst)) {
                    sprintf(backbuf, "%s %s", messageText, entry->name);
-                   (**callBack)(VOS_ERROR_MESSAGE, backbuf);
+                   (**callBack) (VOS_ERROR_MESSAGE, backbuf);
                }
            }
            continue;
@@ -456,17 +442,17 @@ int ADMINAPI vos_BackupVolumeCreateMultiple(
         */
 
        if (serverHandle != NULL) {
-           if (!VLDB_IsSameAddrs(c_handle,
-                                 ntohl(rx_HostOf(rx_PeerOf(f_server->serv))),
-                                 rw_server, &equal, &tst)) {
+           if (!VLDB_IsSameAddrs
+               (c_handle, ntohl(rx_HostOf(rx_PeerOf(f_server->serv))),
+                rw_server, &equal, &tst)) {
                if (callBack != NULL) {
                    const char *messageText;
-                   if (util_AdminErrorCodeTranslate(ADMVOSVLDBBADSERVER, 0,
-                                                    &messageText, &tst)) {
+                   if (util_AdminErrorCodeTranslate
+                       (ADMVOSVLDBBADSERVER, 0, &messageText, &tst)) {
                        sprintf(backbuf, "%s %x %d", messageText,
                                ntohl(rx_HostOf(rx_PeerOf(f_server->serv))),
                                tst);
-                       (**callBack)(VOS_ERROR_MESSAGE, backbuf);
+                       (**callBack) (VOS_ERROR_MESSAGE, backbuf);
                    }
                }
                continue;
@@ -474,11 +460,10 @@ int ADMINAPI vos_BackupVolumeCreateMultiple(
            if (!equal) {
                if (callBack != NULL) {
                    const char *messageText;
-                   if (util_AdminErrorCodeTranslate(ADMVOSVLDBDIFFERENTADDR, 0,
-                                                    &messageText, &tst)) {
-                       sprintf(backbuf, "%s %s", messageText,
-                               entry->name);
-                       (**callBack)(VOS_ERROR_MESSAGE, backbuf);
+                   if (util_AdminErrorCodeTranslate
+                       (ADMVOSVLDBDIFFERENTADDR, 0, &messageText, &tst)) {
+                       sprintf(backbuf, "%s %s", messageText, entry->name);
+                       (**callBack) (VOS_ERROR_MESSAGE, backbuf);
                    }
                }
                continue;
@@ -500,17 +485,18 @@ int ADMINAPI vos_BackupVolumeCreateMultiple(
         * Backup the volume
         */
 
-       rc = UV_BackupVolume(c_handle, rw_server, rw_partition, rw_volid, &tst);
+       rc = UV_BackupVolume(c_handle, rw_server, rw_partition, rw_volid,
+                            &tst);
     }
 
-fail_vos_BackupVolumeCreateMultiple:
+  fail_vos_BackupVolumeCreateMultiple:
 
     if (arrayEntries.nbulkentries_val) {
        free(arrayEntries.nbulkentries_val);
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -543,33 +529,30 @@ fail_vos_BackupVolumeCreateMultiple:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_PartitionGet(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int partition,
-  vos_partitionEntry_p partitionP,
-  afs_status_p st)
+int ADMINAPI
+vos_PartitionGet(const void *cellHandle, const void *serverHandle,
+                vos_MessageCallBack_t callBack, unsigned int partition,
+                vos_partitionEntry_p partitionP, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     struct diskPartition part_info;
     file_server_p f_server = (file_server_p) serverHandle;
-    char partitionName[10]; /* this rpc requires a character partition name */
+    char partitionName[10];    /* this rpc requires a character partition name */
 
     /*
      * Validate arguments
      */
 
     if (!IsValidServerHandle(f_server, &tst)) {
-        goto fail_vos_PartitionGet;
+       goto fail_vos_PartitionGet;
     }
 
     if (partitionP == NULL) {
        tst = ADMVOSPARTITIONPNULL;
        goto fail_vos_PartitionGet;
     }
+
     if (!vos_PartitionIdToName(partition, partitionName, &tst)) {
        goto fail_vos_PartitionGet;
     }
@@ -578,17 +561,19 @@ int ADMINAPI vos_PartitionGet(
     if (tst) {
        goto fail_vos_PartitionGet;
     }
-    strcpy(partitionP->name, part_info.name);
-    strcpy(partitionP->deviceName, part_info.devName);
+    strncpy(partitionP->name, part_info.name, VOS_MAX_PARTITION_NAME_LEN);
+    partitionP->name[VOS_MAX_PARTITION_NAME_LEN-1] = '\0';
+    strncpy(partitionP->deviceName, part_info.devName, VOS_MAX_PARTITION_NAME_LEN);
+    partitionP->deviceName[VOS_MAX_PARTITION_NAME_LEN-1] = '\0';
     partitionP->lockFileDescriptor = part_info.lock_fd;
     partitionP->totalSpace = part_info.minFree;
     partitionP->totalFreeSpace = part_info.free;
     rc = 1;
 
-fail_vos_PartitionGet:
+  fail_vos_PartitionGet:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -598,25 +583,22 @@ fail_vos_PartitionGet:
  */
 
 typedef struct partition_get {
-    afs_int32 total_received; /* the total number of valid partiions retrieved */
-    int number_processed; /* the number of valid paritions we've handed out */
-    int index; /* the current index into the part_list array */
-    struct partList part_list; /* the list of partitions */
-    vos_partitionEntry_t partition[CACHED_ITEMS]; /* the cache of partitions */
-    const void *server; /* the server where the parititions exist */
+    afs_int32 total_received;  /* the total number of valid partiions retrieved */
+    int number_processed;      /* the number of valid paritions we've handed out */
+    int index;                 /* the current index into the part_list array */
+    struct partList part_list; /* the list of partitions */
+    vos_partitionEntry_t partition[CACHED_ITEMS];      /* the cache of partitions */
+    const void *server;                /* the server where the parititions exist */
 } partition_get_t, *partition_get_p;
 
-static int GetPartitionInfoRPC(
-  void *rpc_specific,
-  int slot,
-  int *last_item,
-  int *last_item_contains_data,
-  afs_status_p st)
+static int
+GetPartitionInfoRPC(void *rpc_specific, int slot, int *last_item,
+                   int *last_item_contains_data, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     partition_get_p part = (partition_get_p) rpc_specific;
-    vos_partitionEntry_p ptr = (vos_partitionEntry_p) &part->partition[slot];
+    vos_partitionEntry_p ptr = (vos_partitionEntry_p) & part->partition[slot];
 
     /*
      * Skip partition entries that are not valid
@@ -630,9 +612,9 @@ static int GetPartitionInfoRPC(
      * Get information for the next partition
      */
 
-    if (!vos_PartitionGet(0, part->server, 0,
-                         (unsigned int) part->part_list.partId[part->index],
-                         ptr, &tst)) {
+    if (!vos_PartitionGet
+       (0, part->server, 0,
+        (unsigned int)part->part_list.partId[part->index], ptr, &tst)) {
        goto fail_GetPartitionInfoRPC;
     }
 
@@ -645,7 +627,7 @@ static int GetPartitionInfoRPC(
     }
     rc = 1;
 
-fail_GetPartitionInfoRPC:
+  fail_GetPartitionInfoRPC:
 
     if (st != NULL) {
        *st = tst;
@@ -653,17 +635,15 @@ fail_GetPartitionInfoRPC:
     return rc;
 }
 
-static int GetPartitionInfoFromCache(
-  void *rpc_specific,
-  int slot,
-  void *dest,
-  afs_status_p st)
+static int
+GetPartitionInfoFromCache(void *rpc_specific, int slot, void *dest,
+                         afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     partition_get_p part = (partition_get_p) rpc_specific;
 
-    memcpy(dest, (const void *) &part->partition[slot],
+    memcpy(dest, (const void *)&part->partition[slot],
           sizeof(vos_partitionEntry_t));
     rc = 1;
 
@@ -699,34 +679,32 @@ static int GetPartitionInfoFromCache(
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_PartitionGetBegin(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  void **iterationIdP,
-  afs_status_p st)
+int ADMINAPI
+vos_PartitionGetBegin(const void *cellHandle, const void *serverHandle,
+                     vos_MessageCallBack_t callBack, void **iterationIdP,
+                     afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     file_server_p f_server = (file_server_p) serverHandle;
-    afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
-    partition_get_p part = (partition_get_p) calloc(1, sizeof(partition_get_t));
+    afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
+    partition_get_p part = calloc(1, sizeof(partition_get_t));
 
     /*
      * Validate arguments
      */
 
     if (!IsValidServerHandle(f_server, &tst)) {
-        goto fail_vos_PartitionGetBegin;
+       goto fail_vos_PartitionGetBegin;
     }
 
     if (iterationIdP == NULL) {
-        goto fail_vos_PartitionGetBegin;
+       goto fail_vos_PartitionGetBegin;
     }
-       
+
     if ((iter == NULL) || (part == NULL)) {
        tst = ADMNOMEM;
-        goto fail_vos_PartitionGetBegin;
+       goto fail_vos_PartitionGetBegin;
     }
 
     /*
@@ -734,8 +712,8 @@ int ADMINAPI vos_PartitionGetBegin(
      */
 
     part->server = serverHandle;
-    if (!UV_ListPartitions(f_server->serv, &part->part_list,
-                           &part->total_received, &tst)) {
+    if (!UV_ListPartitions
+       (f_server->serv, &part->part_list, &part->total_received, &tst)) {
        goto fail_vos_PartitionGetBegin;
     }
 
@@ -745,21 +723,22 @@ int ADMINAPI vos_PartitionGetBegin(
      */
 
     if (part->total_received == 0) {
-       if (!IteratorInit(iter, (void *) part, NULL, NULL, NULL, NULL, &tst)) {
+       if (!IteratorInit(iter, (void *)part, NULL, NULL, NULL, NULL, &tst)) {
            goto fail_vos_PartitionGetBegin;
        }
        iter->done_iterating = 1;
        iter->st = ADMITERATORDONE;
     } else {
-       if (!IteratorInit(iter, (void *) part, GetPartitionInfoRPC,
-                        GetPartitionInfoFromCache, NULL, NULL, &tst)) {
+       if (!IteratorInit
+           (iter, (void *)part, GetPartitionInfoRPC,
+            GetPartitionInfoFromCache, NULL, NULL, &tst)) {
            goto fail_vos_PartitionGetBegin;
        }
     }
-    *iterationIdP = (void *) iter;
+    *iterationIdP = (void *)iter;
     rc = 1;
-fail_vos_PartitionGetBegin:
+
+  fail_vos_PartitionGetBegin:
 
     if (rc == 0) {
        if (iter != NULL) {
@@ -771,7 +750,7 @@ fail_vos_PartitionGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -795,10 +774,9 @@ fail_vos_PartitionGetBegin:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_PartitionGetNext(
-  const void *iterationId,
-  vos_partitionEntry_p partitionP,
-  afs_status_p st)
+int ADMINAPI
+vos_PartitionGetNext(const void *iterationId, vos_partitionEntry_p partitionP,
+                    afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -814,12 +792,12 @@ int ADMINAPI vos_PartitionGetNext(
        goto fail_vos_PartitionGetNext;
     }
 
-    rc = IteratorNext(iter, (void *) partitionP, &tst);
+    rc = IteratorNext(iter, (void *)partitionP, &tst);
 
-fail_vos_PartitionGetNext:
+  fail_vos_PartitionGetNext:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -840,29 +818,28 @@ fail_vos_PartitionGetNext:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_PartitionGetDone(
-  const void *iterationId,
-  afs_status_p st)
+int ADMINAPI
+vos_PartitionGetDone(const void *iterationId, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
+
     /*
      * Validate arguments
      */
+
     if (iter == NULL) {
-        tst = ADMITERATORNULL;
-        goto fail_vos_PartitionGetDone;
+       tst = ADMITERATORNULL;
+       goto fail_vos_PartitionGetDone;
     }
+
     rc = IteratorDone(iter, &tst);
 
-fail_vos_PartitionGetDone:
+  fail_vos_PartitionGetDone:
+
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -890,23 +867,21 @@ fail_vos_PartitionGetDone:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_ServerOpen(
-  const void *cellHandle,
-  const char *serverName,
-  void **serverHandleP,
-  afs_status_p st)
+int ADMINAPI
+vos_ServerOpen(const void *cellHandle, const char *serverName,
+              void **serverHandleP, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
-    file_server_p f_server = (file_server_p) malloc(sizeof(file_server_t));
+    file_server_p f_server = malloc(sizeof(file_server_t));
     int server_address;
     struct rx_securityClass *sc[3];
     int scIndex;
 
     if (f_server == NULL) {
-        tst = ADMNOMEM;
-        goto fail_vos_ServerOpen;
+       tst = ADMNOMEM;
+       goto fail_vos_ServerOpen;
     }
 
     /*
@@ -922,31 +897,32 @@ int ADMINAPI vos_ServerOpen(
        goto fail_vos_ServerOpen;
     }
 
-    if (!util_AdminServerAddressGetFromName(serverName, &server_address,
-                                           &tst)) {
+    if (!util_AdminServerAddressGetFromName
+       (serverName, &server_address, &tst)) {
        goto fail_vos_ServerOpen;
     }
 
     scIndex = c_handle->tokens->sc_index;
     sc[scIndex] = c_handle->tokens->afs_sc[scIndex];
-    f_server->serv = rx_GetCachedConnection(htonl(server_address),
-                                       htons(AFSCONF_VOLUMEPORT),
-                                       VOLSERVICE_ID, sc[scIndex], scIndex);
+    f_server->serv =
+       rx_GetCachedConnection(htonl(server_address),
+                              htons(AFSCONF_VOLUMEPORT), VOLSERVICE_ID,
+                              sc[scIndex], scIndex);
     if (f_server->serv != NULL) {
        f_server->begin_magic = BEGIN_MAGIC;
        f_server->end_magic = END_MAGIC;
        f_server->is_valid = 1;
-       *serverHandleP = (void *) f_server;
+       *serverHandleP = (void *)f_server;
        rc = 1;
     } else {
        tst = ADMVOSSERVERNOCONNECTION;
        goto fail_vos_ServerOpen;
     }
-fail_vos_ServerOpen:
+
+  fail_vos_ServerOpen:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -967,14 +943,13 @@ fail_vos_ServerOpen:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_ServerClose(
-  const void *serverHandle,
-  afs_status_p st)
+int ADMINAPI
+vos_ServerClose(const void *serverHandle, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     file_server_p f_server = (file_server_p) serverHandle;
+
     if (!IsValidServerHandle(f_server, &tst)) {
        goto fail_vos_ServerClose;
     }
@@ -984,10 +959,10 @@ int ADMINAPI vos_ServerClose(
     free(f_server);
     rc = 1;
 
-fail_vos_ServerClose:
+  fail_vos_ServerClose:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1019,12 +994,10 @@ fail_vos_ServerClose:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_ServerSync(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  const unsigned int *partition,
-  afs_status_p st)
+int ADMINAPI
+vos_ServerSync(const void *cellHandle, const void *serverHandle,
+              vos_MessageCallBack_t callBack, const unsigned int *partition,
+              afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -1032,7 +1005,7 @@ int ADMINAPI vos_ServerSync(
     file_server_p f_server = (file_server_p) serverHandle;
     afs_int32 part = 0;
     int flags = 0;
+
     /*
      * Validate arguments
      */
@@ -1050,7 +1023,7 @@ int ADMINAPI vos_ServerSync(
            tst = ADMVOSPARTITIONTOOLARGE;
            goto fail_vos_ServerSync;
        }
-       part = (afs_int32) *partition;
+       part = (afs_int32) * partition;
        flags = 1;
     }
 
@@ -1059,11 +1032,11 @@ int ADMINAPI vos_ServerSync(
      */
 
     rc = UV_SyncServer(c_handle, f_server->serv, part, flags, &tst);
-fail_vos_ServerSync:
+
+  fail_vos_ServerSync:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1092,17 +1065,16 @@ fail_vos_ServerSync:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_FileServerAddressChange(
-  const void *cellHandle,
-  vos_MessageCallBack_t callBack,
-  int oldAddress,
-  int newAddress,
-  afs_status_p st)
+int ADMINAPI
+vos_FileServerAddressChange(const void *cellHandle,
+                           vos_MessageCallBack_t callBack,
+                           unsigned int oldAddress,
+                           unsigned int newAddress, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
+
     /*
      * Validate arguments
      */
@@ -1111,17 +1083,17 @@ int ADMINAPI vos_FileServerAddressChange(
        goto fail_vos_FileServerAddressChange;
     }
 
-    tst = ubik_Call_New(VL_ChangeAddr, c_handle->vos, 0,
-                       oldAddress, newAddress);
+    tst =
+       ubik_VL_ChangeAddr(c_handle->vos, 0, oldAddress, newAddress);
     if (tst) {
        goto fail_vos_FileServerAddressChange;
     }
     rc = 1;
-fail_vos_FileServerAddressChange:
+
+  fail_vos_FileServerAddressChange:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1148,17 +1120,17 @@ fail_vos_FileServerAddressChange:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_FileServerAddressRemove(
-  const void *cellHandle,
-  vos_MessageCallBack_t callBack,
-  int serverAddress,
-  afs_status_p st)
+int ADMINAPI
+vos_FileServerAddressRemove(const void *cellHandle,
+                           vos_MessageCallBack_t callBack,
+                           unsigned int serverAddress,
+                           afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
-    int dummyAddress = 0xffffffff;
+    unsigned int dummyAddress = 0xffffffff;
+
     /*
      * Validate arguments
      */
@@ -1167,17 +1139,18 @@ int ADMINAPI vos_FileServerAddressRemove(
        goto fail_vos_FileServerAddressRemove;
     }
 
-    tst = ubik_Call_New(VL_ChangeAddr, c_handle->vos, 0,
-                       dummyAddress, serverAddress);
+    tst =
+       ubik_VL_ChangeAddr(c_handle->vos, 0, dummyAddress,
+                     serverAddress);
     if (tst) {
        goto fail_vos_FileServerAddressRemove;
     }
     rc = 1;
-fail_vos_FileServerAddressRemove:
+
+  fail_vos_FileServerAddressRemove:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1192,19 +1165,16 @@ fail_vos_FileServerAddressRemove:
  */
 
 typedef struct server_get {
-  struct ubik_client *vldb; /* connection for future rpc's if neccessary */
-  afs_int32 total_addresses; /* total number of addresses */
-  bulkaddrs addresses; /* the list of addresses */
-  int address_index; /* current index into address list */
-  vos_fileServerEntry_t server[CACHED_ITEMS]; /* the cache of servers */
+    struct ubik_client *vldb;  /* connection for future rpc's if neccessary */
+    afs_int32 total_addresses; /* total number of addresses */
+    bulkaddrs addresses;       /* the list of addresses */
+    int address_index;         /* current index into address list */
+    vos_fileServerEntry_t server[CACHED_ITEMS];        /* the cache of servers */
 } server_get_t, *server_get_p;
 
-static int GetServerRPC(
-  void *rpc_specific,
-  int slot,
-  int *last_item,
-  int *last_item_contains_data,
-  afs_status_p st)
+static int
+GetServerRPC(void *rpc_specific, int slot, int *last_item,
+            int *last_item_contains_data, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -1222,27 +1192,26 @@ static int GetServerRPC(
      * Check to see if this is a multihomed address server
      */
 
-    if ( ((*addrP & 0xff000000) == 0xff000000) && ((*addrP)&0xffff) ) {
-       base = (*addrP>>16) & 0xff;
+    if (((*addrP & 0xff000000) == 0xff000000) && ((*addrP) & 0xffff)) {
+       base = (*addrP >> 16) & 0xff;
        index = (*addrP) & 0xffff;
 
-       if ((base >= 0) && (base <= VL_MAX_ADDREXTBLKS) &&
-           (index >= 1) && (index <= VL_MHSRV_PERBLK)) {
+       if ((base >= 0) && (base <= VL_MAX_ADDREXTBLKS) && (index >= 1)
+           && (index <= VL_MHSRV_PERBLK)) {
 
            /*
             * This is a multihomed server.  Make an rpc to retrieve
             * all its addresses.  Copy the addresses into the cache.
             */
 
-           m_attrs.Mask  = VLADDR_INDEX;
+           m_attrs.Mask = VLADDR_INDEX;
            m_attrs.index = (base * VL_MHSRV_PERBLK) + index;
            total_multi = 0;
            addr_multi.bulkaddrs_val = 0;
            addr_multi.bulkaddrs_len = 0;
-           tst = ubik_Call(VL_GetAddrsU, serv->vldb, 0, &m_attrs, &m_uuid,
-                           &m_unique,
-                           &total_multi,
-                           &addr_multi);
+           tst =
+               ubik_VL_GetAddrsU(serv->vldb, 0, &m_attrs, &m_uuid,
+                         &m_unique, &total_multi, &addr_multi);
            if (tst) {
                goto fail_GetServerRPC;
            }
@@ -1252,14 +1221,14 @@ static int GetServerRPC(
             * been unable to remove.
             */
 
-           RemoveBadAddresses (&total_multi, &addr_multi);
+           RemoveBadAddresses(&total_multi, &addr_multi);
 
            /*
             * Copy all the addresses into the cache
             */
 
-           for(i=0;i<total_multi;i++) {
-               serv->server[slot].serverAddress[i] = 
+           for (i = 0; i < total_multi; i++) {
+               serv->server[slot].serverAddress[i] =
                    addr_multi.bulkaddrs_val[i];
            }
 
@@ -1268,9 +1237,9 @@ static int GetServerRPC(
            free(addr_multi.bulkaddrs_val);
        }
 
-    /*
-     * The next address is just a plain old address
-     */
+       /*
+        * The next address is just a plain old address
+        */
 
     } else {
        serv->server[slot].serverAddress[0] = *addrP;
@@ -1289,7 +1258,7 @@ static int GetServerRPC(
     }
     rc = 1;
 
-fail_GetServerRPC:
+  fail_GetServerRPC:
 
     if (st != NULL) {
        *st = tst;
@@ -1297,17 +1266,14 @@ fail_GetServerRPC:
     return rc;
 }
 
-static int GetServerFromCache(
-  void *rpc_specific,
-  int slot,
-  void *dest,
-  afs_status_p st)
+static int
+GetServerFromCache(void *rpc_specific, int slot, void *dest, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     server_get_p serv = (server_get_p) rpc_specific;
 
-    memcpy(dest, (const void *) &serv->server[slot],
+    memcpy(dest, (const void *)&serv->server[slot],
           sizeof(vos_fileServerEntry_t));
     rc = 1;
 
@@ -1318,9 +1284,8 @@ static int GetServerFromCache(
 }
 
 
-static int DestroyServer(
-  void *rpc_specific,
-  afs_status_p st)
+static int
+DestroyServer(void *rpc_specific, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -1360,19 +1325,17 @@ static int DestroyServer(
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_FileServerGetBegin(
-  const void *cellHandle,
-  vos_MessageCallBack_t callBack,
-  void **iterationIdP,
-  afs_status_p st)
+int ADMINAPI
+vos_FileServerGetBegin(const void *cellHandle, vos_MessageCallBack_t callBack,
+                      void **iterationIdP, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
-    afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
-    server_get_p serv = (server_get_p) calloc(1, sizeof(server_get_t));
+    afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
+    server_get_p serv = calloc(1, sizeof(server_get_t));
     struct VLCallBack unused;
+
 
     /*
      * Validate arguments
@@ -1383,12 +1346,12 @@ int ADMINAPI vos_FileServerGetBegin(
     }
 
     if (iterationIdP == NULL) {
-        goto fail_vos_FileServerGetBegin;
+       goto fail_vos_FileServerGetBegin;
     }
-       
+
     if ((iter == NULL) || (serv == NULL)) {
        tst = ADMNOMEM;
-        goto fail_vos_FileServerGetBegin;
+       goto fail_vos_FileServerGetBegin;
     }
 
     /*
@@ -1396,8 +1359,9 @@ int ADMINAPI vos_FileServerGetBegin(
      */
 
     serv->vldb = c_handle->vos;
-    tst = ubik_Call_New(VL_GetAddrs, c_handle->vos, 0, 0, 0, &unused, 
-                       &serv->total_addresses, &serv->addresses);
+    tst =
+       ubik_VL_GetAddrs(c_handle->vos, 0, 0, 0, &unused,
+                     &serv->total_addresses, &serv->addresses);
 
     if (tst) {
        goto fail_vos_FileServerGetBegin;
@@ -1408,24 +1372,25 @@ int ADMINAPI vos_FileServerGetBegin(
      * been unable to remove.
      */
 
-    RemoveBadAddresses (&serv->total_addresses, &serv->addresses);
+    RemoveBadAddresses(&serv->total_addresses, &serv->addresses);
 
     if (serv->total_addresses == 0) {
-       if (!IteratorInit(iter, (void *) serv, NULL, NULL, NULL, NULL, &tst)) {
+       if (!IteratorInit(iter, (void *)serv, NULL, NULL, NULL, NULL, &tst)) {
            goto fail_vos_FileServerGetBegin;
        }
        iter->done_iterating = 1;
        iter->st = ADMITERATORDONE;
     } else {
-       if (!IteratorInit(iter, (void *) serv, GetServerRPC,
-                        GetServerFromCache, NULL, DestroyServer, &tst)) {
+       if (!IteratorInit
+           (iter, (void *)serv, GetServerRPC, GetServerFromCache, NULL,
+            DestroyServer, &tst)) {
            goto fail_vos_FileServerGetBegin;
        }
     }
-    *iterationIdP = (void *) iter;
+    *iterationIdP = (void *)iter;
     rc = 1;
 
-fail_vos_FileServerGetBegin:
+  fail_vos_FileServerGetBegin:
 
     if (rc == 0) {
        if (iter != NULL) {
@@ -1440,7 +1405,7 @@ fail_vos_FileServerGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1465,10 +1430,9 @@ fail_vos_FileServerGetBegin:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_FileServerGetNext(
-  void *iterationId,
-  vos_fileServerEntry_p serverEntryP,
-  afs_status_p st)
+int ADMINAPI
+vos_FileServerGetNext(void *iterationId, vos_fileServerEntry_p serverEntryP,
+                     afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -1484,12 +1448,12 @@ int ADMINAPI vos_FileServerGetNext(
        goto fail_vos_FileServerGetNext;
     }
 
-    rc = IteratorNext(iter, (void *) serverEntryP, &tst);
-fail_vos_FileServerGetNext:
+    rc = IteratorNext(iter, (void *)serverEntryP, &tst);
+
+  fail_vos_FileServerGetNext:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1510,29 +1474,28 @@ fail_vos_FileServerGetNext:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_FileServerGetDone(
-  void *iterationId,
-  afs_status_p st)
+int ADMINAPI
+vos_FileServerGetDone(void *iterationId, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
+
     /*
      * Validate arguments
      */
+
     if (iter == NULL) {
-        tst = ADMITERATORNULL;
-        goto fail_vos_FileServerGetDone;
+       tst = ADMITERATORNULL;
+       goto fail_vos_FileServerGetDone;
     }
+
     rc = IteratorDone(iter, &tst);
-fail_vos_FileServerGetDone:
+
+  fail_vos_FileServerGetDone:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1542,18 +1505,15 @@ fail_vos_FileServerGetDone:
  */
 
 typedef struct transaction_get {
-  afs_int32 total; /* total number of transactions */
-  afs_int32 index; /* index to the current transaction */
-  transDebugInfo *cur; /* the current transaction */
-  vos_serverTransactionStatus_t tran[CACHED_ITEMS]; /* the cache of trans */
+    afs_int32 total;           /* total number of transactions */
+    afs_int32 index;           /* index to the current transaction */
+    transDebugInfo *cur;       /* the current transaction */
+    vos_serverTransactionStatus_t tran[CACHED_ITEMS];  /* the cache of trans */
 } transaction_get_t, *transaction_get_p;
 
-static int GetTransactionRPC(
-  void *rpc_specific,
-  int slot,
-  int *last_item,
-  int *last_item_contains_data,
-  afs_status_p st)
+static int
+GetTransactionRPC(void *rpc_specific, int slot, int *last_item,
+                 int *last_item_contains_data, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -1578,38 +1538,37 @@ static int GetTransactionRPC(
 
     t->tran[slot].volumeAttachMode = VOS_VOLUME_ATTACH_MODE_OK;
 
-    switch(t->cur[index].iflags){
-      case ITOffline: 
+    switch (t->cur[index].iflags) {
+    case ITOffline:
        t->tran[slot].volumeAttachMode = VOS_VOLUME_ATTACH_MODE_OFFLINE;
        break;
-      case ITBusy:
+    case ITBusy:
        t->tran[slot].volumeAttachMode = VOS_VOLUME_ATTACH_MODE_BUSY;
        break;
-      case ITReadOnly:
+    case ITReadOnly:
        t->tran[slot].volumeAttachMode = VOS_VOLUME_ATTACH_MODE_READONLY;
        break;
-      case ITCreate:
+    case ITCreate:
        t->tran[slot].volumeAttachMode = VOS_VOLUME_ATTACH_MODE_CREATE;
        break;
-      case ITCreateVolID:
+    case ITCreateVolID:
        t->tran[slot].volumeAttachMode = VOS_VOLUME_ATTACH_MODE_CREATE_VOLID;
        break;
     }
 
     t->tran[slot].volumeActiveStatus = VOS_VOLUME_ACTIVE_STATUS_OK;
 
-    switch(t->cur[index].vflags){
-      case VTDeleteOnSalvage: 
-       t->tran[slot].volumeActiveStatus = 
+    switch (t->cur[index].vflags) {
+    case VTDeleteOnSalvage:
+       t->tran[slot].volumeActiveStatus =
            VOS_VOLUME_ACTIVE_STATUS_DELETE_ON_SALVAGE;
        break;
-      case VTOutOfService: 
-       t->tran[slot].volumeActiveStatus = 
+    case VTOutOfService:
+       t->tran[slot].volumeActiveStatus =
            VOS_VOLUME_ACTIVE_STATUS_OUT_OF_SERVICE;
        break;
-      case VTDeleted: 
-       t->tran[slot].volumeActiveStatus = 
-           VOS_VOLUME_ACTIVE_STATUS_DELETED;
+    case VTDeleted:
+       t->tran[slot].volumeActiveStatus = VOS_VOLUME_ACTIVE_STATUS_DELETED;
        break;
     }
 
@@ -1639,17 +1598,15 @@ static int GetTransactionRPC(
     return rc;
 }
 
-static int GetTransactionFromCache(
-  void *rpc_specific,
-  int slot,
-  void *dest,
-  afs_status_p st)
+static int
+GetTransactionFromCache(void *rpc_specific, int slot, void *dest,
+                       afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     transaction_get_p tran = (transaction_get_p) rpc_specific;
 
-    memcpy(dest, (const void *) &tran->tran[slot],
+    memcpy(dest, (const void *)&tran->tran[slot],
           sizeof(vos_serverTransactionStatus_p));
     rc = 1;
 
@@ -1660,9 +1617,8 @@ static int GetTransactionFromCache(
 }
 
 
-static int DestroyTransaction(
-  void *rpc_specific,
-  afs_status_p st)
+static int
+DestroyTransaction(void *rpc_specific, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -1705,19 +1661,18 @@ static int DestroyTransaction(
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_ServerTransactionStatusGetBegin(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  void **iterationIdP,
-  afs_status_p st)
+int ADMINAPI
+vos_ServerTransactionStatusGetBegin(const void *cellHandle,
+                                   const void *serverHandle,
+                                   vos_MessageCallBack_t callBack,
+                                   void **iterationIdP, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     file_server_p f_server = (file_server_p) serverHandle;
-    afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
-    transaction_get_p tran = (transaction_get_p) calloc(1, sizeof(transaction_get_t));
+    afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
+    transaction_get_p tran = calloc(1, sizeof(transaction_get_t));
+
 
     /*
      * Validate arguments
@@ -1728,12 +1683,12 @@ int ADMINAPI vos_ServerTransactionStatusGetBegin(
     }
 
     if (iterationIdP == NULL) {
-        goto fail_vos_ServerTransactionStatusGetBegin;
+       goto fail_vos_ServerTransactionStatusGetBegin;
     }
-       
+
     if ((iter == NULL) || (tran == NULL)) {
        tst = ADMNOMEM;
-        goto fail_vos_ServerTransactionStatusGetBegin;
+       goto fail_vos_ServerTransactionStatusGetBegin;
     }
 
     /*
@@ -1745,23 +1700,22 @@ int ADMINAPI vos_ServerTransactionStatusGetBegin(
     }
 
     if (tran->total == 0) {
-       if (!IteratorInit(iter, (void *) tran, NULL,
-                        NULL, NULL, NULL, &tst)) {
+       if (!IteratorInit(iter, (void *)tran, NULL, NULL, NULL, NULL, &tst)) {
            goto fail_vos_ServerTransactionStatusGetBegin;
        }
        iter->done_iterating = 1;
        iter->st = ADMITERATORDONE;
     } else {
-       if (!IteratorInit(iter, (void *) tran, GetTransactionRPC,
-                        GetTransactionFromCache, NULL,
-                        DestroyTransaction, &tst)) {
+       if (!IteratorInit
+           (iter, (void *)tran, GetTransactionRPC, GetTransactionFromCache,
+            NULL, DestroyTransaction, &tst)) {
            goto fail_vos_ServerTransactionStatusGetBegin;
        }
     }
-    *iterationIdP = (void *) iter;
+    *iterationIdP = (void *)iter;
     rc = 1;
 
-fail_vos_ServerTransactionStatusGetBegin:
+  fail_vos_ServerTransactionStatusGetBegin:
 
     if (rc == 0) {
        if (iter != NULL) {
@@ -1776,7 +1730,7 @@ fail_vos_ServerTransactionStatusGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1803,10 +1757,10 @@ fail_vos_ServerTransactionStatusGetBegin:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_ServerTransactionStatusGetNext(
-  const void *iterationId,
-  vos_serverTransactionStatus_p serverTransactionStatusP,
-  afs_status_p st)
+int ADMINAPI
+vos_ServerTransactionStatusGetNext(const void *iterationId,
+                                  vos_serverTransactionStatus_p
+                                  serverTransactionStatusP, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -1822,12 +1776,12 @@ int ADMINAPI vos_ServerTransactionStatusGetNext(
        goto fail_vos_ServerTransactionStatusGetNext;
     }
 
-    rc = IteratorNext(iter, (void *) serverTransactionStatusP, &tst);
-fail_vos_ServerTransactionStatusGetNext:
+    rc = IteratorNext(iter, (void *)serverTransactionStatusP, &tst);
+
+  fail_vos_ServerTransactionStatusGetNext:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1849,52 +1803,49 @@ fail_vos_ServerTransactionStatusGetNext:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_ServerTransactionStatusGetDone(
-  const void *iterationId,
-  afs_status_p st)
+int ADMINAPI
+vos_ServerTransactionStatusGetDone(const void *iterationId, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
+
     /*
      * Validate arguments
      */
+
     if (iter == NULL) {
-        tst = ADMITERATORNULL;
-        goto fail_vos_ServerTransactionStatusGetDone;
+       tst = ADMITERATORNULL;
+       goto fail_vos_ServerTransactionStatusGetDone;
     }
+
     rc = IteratorDone(iter, &tst);
-fail_vos_ServerTransactionStatusGetDone:
+
+  fail_vos_ServerTransactionStatusGetDone:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
 
-static int copyVLDBEntry(
-    struct nvldbentry *source,
-    vos_vldbEntry_p dest,
-    afs_status_p st)
+static int
+copyVLDBEntry(struct nvldbentry *source, vos_vldbEntry_p dest,
+             afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     int i;
 
     dest->numServers = source->nServers;
-    for (i=0;i<VOS_MAX_VOLUME_TYPES;i++) {
+    for (i = 0; i < VOS_MAX_VOLUME_TYPES; i++) {
        dest->volumeId[i] = source->volumeId[i];
     }
     dest->cloneId = source->cloneId;
     dest->status = VOS_VLDB_ENTRY_OK;
     if (source->flags & VLOP_ALLOPERS) {
        dest->status |= VOS_VLDB_ENTRY_LOCKED;
-    }
-    else {
+    } else {
        if (source->flags & VLOP_MOVE) {
            dest->status |= VOS_VLDB_ENTRY_MOVE;
        }
@@ -1921,28 +1872,29 @@ static int copyVLDBEntry(
        dest->status |= VOS_VLDB_ENTRY_BACKEXISTS;
     }
 
-    strcpy(dest->name, source->name);
-    for (i=0;i<VOS_MAX_REPLICA_SITES;i++) {
+    strncpy(dest->name, source->name, VOS_MAX_VOLUME_NAME_LEN);
+    dest->name[VOS_MAX_VOLUME_NAME_LEN - 1] = '\0';
+    for (i = 0; i < VOS_MAX_REPLICA_SITES; i++) {
        dest->volumeSites[i].serverAddress = source->serverNumber[i];
        dest->volumeSites[i].serverPartition = source->serverPartition[i];
        dest->volumeSites[i].serverFlags = 0;
 
-       if (source->serverFlags[i] & NEW_REPSITE) {
+       if (source->serverFlags[i] & VLSF_NEWREPSITE) {
            dest->volumeSites[i].serverFlags |= VOS_VLDB_NEW_REPSITE;
        }
-       if (source->serverFlags[i] & ITSROVOL) {
+       if (source->serverFlags[i] & VLSF_ROVOL) {
            dest->volumeSites[i].serverFlags |= VOS_VLDB_READ_ONLY;
        }
-       if (source->serverFlags[i] & ITSRWVOL) {
+       if (source->serverFlags[i] & VLSF_RWVOL) {
            dest->volumeSites[i].serverFlags |= VOS_VLDB_READ_WRITE;
        }
-       if (source->serverFlags[i] & ITSBACKVOL) {
+       if (source->serverFlags[i] & VLSF_BACKVOL) {
            dest->volumeSites[i].serverFlags |= VOS_VLDB_BACKUP;
        }
-       if (source->serverFlags[i] & RO_DONTUSE) {
+       if (source->serverFlags[i] & VLSF_DONTUSE) {
            dest->volumeSites[i].serverFlags |= VOS_VLDB_DONT_USE;
        }
-       
+
     }
 
     rc = 1;
@@ -1979,19 +1931,16 @@ static int copyVLDBEntry(
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VLDBGet(
-  const void *cellHandle,
-  vos_MessageCallBack_t callBack,
-  const unsigned int *volumeId,
-  const char *volumeName,
-  vos_vldbEntry_p vldbEntry,
-  afs_status_p st)
+int ADMINAPI
+vos_VLDBGet(const void *cellHandle, vos_MessageCallBack_t callBack,
+           const unsigned int *volumeId, char *volumeName,
+           vos_vldbEntry_p vldbEntry, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
     struct nvldbentry entry;
+
 
     /*
      * Validate arguments
@@ -2006,8 +1955,7 @@ int ADMINAPI vos_VLDBGet(
        goto fail_vos_VLDBGet;
     }
 
-    if (((volumeName == NULL) || (*volumeName == 0)) &&
-       (volumeId == NULL)) {
+    if (((volumeName == NULL) || (*volumeName == 0)) && (volumeId == NULL)) {
        tst = ADMVOSVOLUMENAMEANDVOLUMEIDNULL;
        goto fail_vos_VLDBGet;
     }
@@ -2020,11 +1968,11 @@ int ADMINAPI vos_VLDBGet(
        if (!ValidateVolumeName(volumeName, &tst)) {
            goto fail_vos_VLDBGet;
        }
-       if (!VLDB_GetEntryByName(c_handle, volumeName, &entry, &tst)) {
+       if (!aVLDB_GetEntryByName(c_handle, volumeName, &entry, &tst)) {
            goto fail_vos_VLDBGet;
        }
     } else {
-       if (!VLDB_GetEntryByID(c_handle, *volumeId, -1, &entry, &tst)) {
+       if (!aVLDB_GetEntryByID(c_handle, *volumeId, -1, &entry, &tst)) {
            goto fail_vos_VLDBGet;
        }
     }
@@ -2037,11 +1985,11 @@ int ADMINAPI vos_VLDBGet(
        goto fail_vos_VLDBGet;
     }
     rc = 1;
-fail_vos_VLDBGet:
+
+  fail_vos_VLDBGet:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2051,18 +1999,15 @@ fail_vos_VLDBGet:
  */
 
 typedef struct vldb_entry_get {
-  afs_int32 total; /* total number of vldb entries */
-  afs_int32 index; /* index to the current vldb entry */
-  nbulkentries entries; /* the list of entries retrieved */
-  vos_vldbEntry_t entry[CACHED_ITEMS]; /* the cache of entries */
+    afs_int32 total;           /* total number of vldb entries */
+    afs_int32 index;           /* index to the current vldb entry */
+    nbulkentries entries;      /* the list of entries retrieved */
+    vos_vldbEntry_t entry[CACHED_ITEMS];       /* the cache of entries */
 } vldb_entry_get_t, *vldb_entry_get_p;
 
-static int GetVLDBEntryRPC(
-  void *rpc_specific,
-  int slot,
-  int *last_item,
-  int *last_item_contains_data,
-  afs_status_p st)
+static int
+GetVLDBEntryRPC(void *rpc_specific, int slot, int *last_item,
+               int *last_item_contains_data, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -2072,9 +2017,9 @@ static int GetVLDBEntryRPC(
      * Copy the next entry into the cache
      */
 
-    if (!copyVLDBEntry(&entry->entries.nbulkentries_val[entry->index],
-                      &entry->entry[slot],
-                      &tst)) {
+    if (!copyVLDBEntry
+       (&entry->entries.nbulkentries_val[entry->index], &entry->entry[slot],
+        &tst)) {
        goto fail_GetVLDBEntryRPC;
     }
     entry->index++;
@@ -2090,7 +2035,7 @@ static int GetVLDBEntryRPC(
     }
     rc = 1;
 
-fail_GetVLDBEntryRPC:
+  fail_GetVLDBEntryRPC:
 
     if (st != NULL) {
        *st = tst;
@@ -2098,18 +2043,15 @@ fail_GetVLDBEntryRPC:
     return rc;
 }
 
-static int GetVLDBEntryFromCache(
-  void *rpc_specific,
-  int slot,
-  void *dest,
-  afs_status_p st)
+static int
+GetVLDBEntryFromCache(void *rpc_specific, int slot, void *dest,
+                     afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     vldb_entry_get_p entry = (vldb_entry_get_p) rpc_specific;
 
-    memcpy(dest, (const void *) &entry->entry[slot],
-          sizeof(vos_vldbEntry_t));
+    memcpy(dest, (const void *)&entry->entry[slot], sizeof(vos_vldbEntry_t));
     rc = 1;
 
     if (st != NULL) {
@@ -2119,9 +2061,8 @@ static int GetVLDBEntryFromCache(
 }
 
 
-static int DestroyVLDBEntry(
-  void *rpc_specific,
-  afs_status_p st)
+static int
+DestroyVLDBEntry(void *rpc_specific, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -2168,20 +2109,17 @@ static int DestroyVLDBEntry(
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VLDBGetBegin(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int *partition,
-  void **iterationIdP,
-  afs_status_p st)
+int ADMINAPI
+vos_VLDBGetBegin(const void *cellHandle, const void *serverHandle,
+                vos_MessageCallBack_t callBack, unsigned int *partition,
+                void **iterationIdP, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
     file_server_p f_server = (file_server_p) serverHandle;
-    afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
-    vldb_entry_get_p entry = (vldb_entry_get_p) calloc(1, sizeof(vldb_entry_get_t));
+    afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
+    vldb_entry_get_p entry = calloc(1, sizeof(vldb_entry_get_t));
     struct VldbListByAttributes attr;
 
     attr.Mask = 0;
@@ -2217,28 +2155,28 @@ int ADMINAPI vos_VLDBGetBegin(
        attr.Mask |= VLLIST_PARTITION;
     }
 
-    if (!VLDB_ListAttributes(c_handle, &attr, &entry->total, &entry->entries, &tst)) {
+    if (!VLDB_ListAttributes
+       (c_handle, &attr, &entry->total, &entry->entries, &tst)) {
        goto fail_vos_VLDBGetBegin;
     }
 
     if (entry->total <= 0) {
-       if (!IteratorInit(iter, (void *) entry, NULL,
-                         NULL, NULL, NULL, &tst)) {
+       if (!IteratorInit(iter, (void *)entry, NULL, NULL, NULL, NULL, &tst)) {
            goto fail_vos_VLDBGetBegin;
        }
        iter->done_iterating = 1;
        iter->st = ADMITERATORDONE;
     } else {
-       if (!IteratorInit(iter, (void *) entry, GetVLDBEntryRPC,
-                         GetVLDBEntryFromCache, NULL,
-                         DestroyVLDBEntry, &tst)) {
+       if (!IteratorInit
+           (iter, (void *)entry, GetVLDBEntryRPC, GetVLDBEntryFromCache,
+            NULL, DestroyVLDBEntry, &tst)) {
            goto fail_vos_VLDBGetBegin;
        }
     }
-    *iterationIdP = (void *) iter;
+    *iterationIdP = (void *)iter;
     rc = 1;
-fail_vos_VLDBGetBegin:
+
+  fail_vos_VLDBGetBegin:
 
     if (rc == 0) {
        if (iter != NULL) {
@@ -2253,7 +2191,7 @@ fail_vos_VLDBGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2279,10 +2217,9 @@ fail_vos_VLDBGetBegin:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VLDBGetNext(
-  const void *iterationId,
-  vos_vldbEntry_p vldbEntry,
-  afs_status_p st)
+int ADMINAPI
+vos_VLDBGetNext(const void *iterationId, vos_vldbEntry_p vldbEntry,
+               afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -2298,12 +2235,12 @@ int ADMINAPI vos_VLDBGetNext(
        goto fail_vos_VLDBGetNext;
     }
 
-    rc = IteratorNext(iter, (void *) vldbEntry, &tst);
-fail_vos_VLDBGetNext:
+    rc = IteratorNext(iter, (void *)vldbEntry, &tst);
+
+  fail_vos_VLDBGetNext:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2324,29 +2261,28 @@ fail_vos_VLDBGetNext:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VLDBGetDone(
-  const void *iterationId,
-  afs_status_p st)
+int ADMINAPI
+vos_VLDBGetDone(const void *iterationId, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
+
     /*
      * Validate arguments
      */
+
     if (iter == NULL) {
-        tst = ADMITERATORNULL;
-        goto fail_vos_VLDBGetDone;
+       tst = ADMITERATORNULL;
+       goto fail_vos_VLDBGetDone;
     }
+
     rc = IteratorDone(iter, &tst);
-fail_vos_VLDBGetDone:
+
+  fail_vos_VLDBGetDone:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2378,13 +2314,11 @@ fail_vos_VLDBGetDone:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VLDBEntryRemove(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  const unsigned int *partition,
-  unsigned int *volumeId,
-  afs_status_p st)
+int ADMINAPI
+vos_VLDBEntryRemove(const void *cellHandle, const void *serverHandle,
+                   vos_MessageCallBack_t callBack,
+                   const unsigned int *partition, unsigned int *volumeId,
+                   afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -2394,7 +2328,7 @@ int ADMINAPI vos_VLDBEntryRemove(
     nbulkentries entries;
     afs_int32 nentries;
     int i;
+
     memset(&attr, 0, sizeof(attr));
     memset(&entries, 0, sizeof(entries));
 
@@ -2411,7 +2345,7 @@ int ADMINAPI vos_VLDBEntryRemove(
      */
 
     if (volumeId != NULL) {
-       tst = ubik_Call(VL_DeleteEntry, c_handle->vos, 0, *volumeId, -1);
+       tst = ubik_VL_DeleteEntry(c_handle->vos, 0, *volumeId, -1);
        if (tst != 0) {
            goto fail_vos_VLDBEntryRemove;
        }
@@ -2448,23 +2382,24 @@ int ADMINAPI vos_VLDBEntryRemove(
        goto fail_vos_VLDBEntryRemove;
     }
 
-    for(i=0;i<nentries;i++) {
-       ubik_Call(VL_DeleteEntry, c_handle->vos, 0, entries.nbulkentries_val[i].volumeId[RWVOL]);
+    for (i = 0; i < nentries; i++) {
+       ubik_VL_DeleteEntry(c_handle->vos, 0,
+                 entries.nbulkentries_val[i].volumeId[RWVOL], -1);
     }
     rc = 1;
 
-fail_vos_VLDBEntryRemove:
+  fail_vos_VLDBEntryRemove:
 
     if (entries.nbulkentries_val) {
        free(entries.nbulkentries_val);
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
+
 /*
  * vos_VLDBUnlock - unlock vldb entries en masse.
  *
@@ -2490,12 +2425,10 @@ fail_vos_VLDBEntryRemove:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VLDBUnlock(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  const unsigned int *partition,
-  afs_status_p st)
+int ADMINAPI
+vos_VLDBUnlock(const void *cellHandle, const void *serverHandle,
+              vos_MessageCallBack_t callBack, const unsigned int *partition,
+              afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -2546,20 +2479,21 @@ int ADMINAPI vos_VLDBUnlock(
        goto fail_vos_VLDBUnlock;
     }
 
-    for(i=0;i<nentries;i++) {
+    for (i = 0; i < nentries; i++) {
        vos_VLDBEntryUnlock(cellHandle, 0,
-                           entries.nbulkentries_val[i].volumeId[RWVOL], &tst);
+                           entries.nbulkentries_val[i].volumeId[RWVOL],
+                           &tst);
     }
     rc = 1;
-fail_vos_VLDBUnlock:
+
+  fail_vos_VLDBUnlock:
 
     if (entries.nbulkentries_val) {
        free(entries.nbulkentries_val);
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2587,11 +2521,9 @@ fail_vos_VLDBUnlock:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VLDBEntryLock(
-  const void *cellHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int volumeId,
-  afs_status_p st)
+int ADMINAPI
+vos_VLDBEntryLock(const void *cellHandle, vos_MessageCallBack_t callBack,
+                 unsigned int volumeId, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -2605,16 +2537,16 @@ int ADMINAPI vos_VLDBEntryLock(
        goto fail_vos_VLDBEntryLock;
     }
 
-    tst = ubik_Call(VL_SetLock, c_handle->vos, 0, volumeId, -1, VLOP_DELETE);
+    tst = ubik_VL_SetLock(c_handle->vos, 0, volumeId, -1, VLOP_DELETE);
     if (tst != 0) {
        goto fail_vos_VLDBEntryLock;
     }
     rc = 1;
-fail_vos_VLDBEntryLock:
+
+  fail_vos_VLDBEntryLock:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2641,11 +2573,9 @@ fail_vos_VLDBEntryLock:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VLDBEntryUnlock(
-  const void *cellHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int volumeId,
-  afs_status_p st)
+int ADMINAPI
+vos_VLDBEntryUnlock(const void *cellHandle, vos_MessageCallBack_t callBack,
+                   unsigned int volumeId, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -2660,17 +2590,18 @@ int ADMINAPI vos_VLDBEntryUnlock(
     }
 
 
-    tst = ubik_Call(VL_ReleaseLock, c_handle->vos, 0, volumeId, -1,
-                    LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
+    tst =
+       ubik_VL_ReleaseLock(c_handle->vos, 0, volumeId, -1,
+                 LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
     if (tst != 0) {
        goto fail_vos_VLDBEntryUnlock;
     }
     rc = 1;
-fail_vos_VLDBEntryUnlock:
+
+  fail_vos_VLDBEntryUnlock:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2702,19 +2633,17 @@ fail_vos_VLDBEntryUnlock:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VLDBReadOnlySiteCreate(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int partition,
-  unsigned int volumeId,
-  afs_status_p st)
+int ADMINAPI
+vos_VLDBReadOnlySiteCreate(const void *cellHandle, const void *serverHandle,
+                          vos_MessageCallBack_t callBack,
+                          unsigned int partition, unsigned int volumeId,
+                          afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
     file_server_p f_server = (file_server_p) serverHandle;
+
     /*
      * Validate arguments
      */
@@ -2732,16 +2661,17 @@ int ADMINAPI vos_VLDBReadOnlySiteCreate(
        goto fail_vos_VLDBReadOnlySiteCreate;
     }
 
-    if (!UV_AddSite(c_handle, ntohl(rx_HostOf(rx_PeerOf(f_server->serv))),
-                   partition, volumeId, &tst)) {
+    if (!UV_AddSite
+       (c_handle, ntohl(rx_HostOf(rx_PeerOf(f_server->serv))), partition,
+        volumeId, &tst)) {
        goto fail_vos_VLDBReadOnlySiteCreate;
     }
     rc = 1;
-fail_vos_VLDBReadOnlySiteCreate:
+
+  fail_vos_VLDBReadOnlySiteCreate:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2774,19 +2704,17 @@ fail_vos_VLDBReadOnlySiteCreate:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VLDBReadOnlySiteDelete(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int partition,
-  unsigned int volumeId,
-  afs_status_p st)
+int ADMINAPI
+vos_VLDBReadOnlySiteDelete(const void *cellHandle, const void *serverHandle,
+                          vos_MessageCallBack_t callBack,
+                          unsigned int partition, unsigned int volumeId,
+                          afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
     file_server_p f_server = (file_server_p) serverHandle;
+
     /*
      * Validate arguments
      */
@@ -2804,16 +2732,17 @@ int ADMINAPI vos_VLDBReadOnlySiteDelete(
        goto fail_vos_VLDBReadOnlySiteDelete;
     }
 
-    if (!UV_RemoveSite(c_handle, ntohl(rx_HostOf(rx_PeerOf(f_server->serv))),
-                   partition, volumeId, &tst)) {
+    if (!UV_RemoveSite
+       (c_handle, ntohl(rx_HostOf(rx_PeerOf(f_server->serv))), partition,
+        volumeId, &tst)) {
        goto fail_vos_VLDBReadOnlySiteDelete;
     }
     rc = 1;
-fail_vos_VLDBReadOnlySiteDelete:
+
+  fail_vos_VLDBReadOnlySiteDelete:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2845,13 +2774,10 @@ fail_vos_VLDBReadOnlySiteDelete:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VLDBSync(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  const unsigned int *partition,
-  vos_force_t force,
-  afs_status_p st)
+int ADMINAPI
+vos_VLDBSync(const void *cellHandle, const void *serverHandle,
+            vos_MessageCallBack_t callBack, const unsigned int *partition,
+            vos_force_t force, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -2860,7 +2786,7 @@ int ADMINAPI vos_VLDBSync(
     afs_int32 part = 0;
     int flags = 0;
     int force_flag = 0;
+
     /*
      * Validate arguments
      */
@@ -2878,7 +2804,7 @@ int ADMINAPI vos_VLDBSync(
            tst = ADMVOSPARTITIONTOOLARGE;
            goto fail_vos_VLDBSync;
        }
-       part = (afs_int32) *partition;
+       part = (afs_int32) * partition;
        flags = 1;
     }
 
@@ -2891,11 +2817,11 @@ int ADMINAPI vos_VLDBSync(
      */
 
     rc = UV_SyncVldb(c_handle, f_server->serv, part, flags, force_flag, &tst);
-fail_vos_VLDBSync:
+
+  fail_vos_VLDBSync:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2932,15 +2858,11 @@ fail_vos_VLDBSync:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VolumeCreate(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int partition,
-  const char *volumeName,
-  unsigned int quota,
-  unsigned int *volumeId,
-  afs_status_p st)
+int ADMINAPI
+vos_VolumeCreate(const void *cellHandle, const void *serverHandle,
+                vos_MessageCallBack_t callBack, unsigned int partition,
+                char *volumeName, unsigned int quota,
+                unsigned int *volumeId, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -2948,7 +2870,7 @@ int ADMINAPI vos_VolumeCreate(
     file_server_p f_server = (file_server_p) serverHandle;
     vos_partitionEntry_t pinfo;
     struct nvldbentry vinfo;
+
     /*
      * Validate arguments
      */
@@ -2979,8 +2901,8 @@ int ADMINAPI vos_VolumeCreate(
      * Check that partition is valid at the server
      */
 
-    if (!vos_PartitionGet(cellHandle, serverHandle, 0, partition,
-                         &pinfo, &tst)) {
+    if (!vos_PartitionGet
+       (cellHandle, serverHandle, 0, partition, &pinfo, &tst)) {
        goto fail_vos_VolumeCreate;
     }
 
@@ -2988,7 +2910,7 @@ int ADMINAPI vos_VolumeCreate(
      * Check that the volume doesn't already exist
      */
 
-    if (VLDB_GetEntryByName(c_handle, volumeName, &vinfo, &tst)) {
+    if (aVLDB_GetEntryByName(c_handle, volumeName, &vinfo, &tst)) {
        tst = ADMVOSVOLUMENAMEDUP;
        goto fail_vos_VolumeCreate;
     }
@@ -2997,13 +2919,13 @@ int ADMINAPI vos_VolumeCreate(
      * Create the new volume
      */
 
-    rc = UV_CreateVolume(c_handle, f_server->serv,
-                        partition, volumeName, quota, volumeId, &tst);
+    rc = UV_CreateVolume(c_handle, f_server->serv, partition, volumeName,
+                        quota, volumeId, &tst);
 
-fail_vos_VolumeCreate:
+  fail_vos_VolumeCreate:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3035,20 +2957,17 @@ fail_vos_VolumeCreate:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VolumeDelete(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int partition,
-  unsigned int volumeId,
-  afs_status_p st)
+int ADMINAPI
+vos_VolumeDelete(const void *cellHandle, const void *serverHandle,
+                vos_MessageCallBack_t callBack, unsigned int partition,
+                unsigned int volumeId, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
     file_server_p f_server = (file_server_p) serverHandle;
     vos_partitionEntry_t pinfo;
+
     /*
      * Validate arguments
      */
@@ -3070,17 +2989,17 @@ int ADMINAPI vos_VolumeDelete(
      * Check that partition is valid at the server
      */
 
-    if (!vos_PartitionGet(cellHandle, serverHandle, 0, 
-                         partition, &pinfo, &tst)) {
+    if (!vos_PartitionGet
+       (cellHandle, serverHandle, 0, partition, &pinfo, &tst)) {
        goto fail_vos_VolumeDelete;
     }
+
     rc = UV_DeleteVolume(c_handle, f_server->serv, partition, volumeId, &tst);
 
-fail_vos_VolumeDelete:
+  fail_vos_VolumeDelete:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3112,18 +3031,16 @@ fail_vos_VolumeDelete:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VolumeRename(
-  const void *cellHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int readWriteVolumeId,
-  const char *newVolumeName,
-  afs_status_p st)
+int ADMINAPI
+vos_VolumeRename(const void *cellHandle, vos_MessageCallBack_t callBack,
+                unsigned int readWriteVolumeId, char *newVolumeName,
+                afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
     struct nvldbentry entry;
+
     /*
      * Validate arguments
      */
@@ -3141,16 +3058,16 @@ int ADMINAPI vos_VolumeRename(
      * Retrieve the entry
      */
 
-    if (!VLDB_GetEntryByID(c_handle, readWriteVolumeId, -1, &entry, &tst)) {
+    if (!aVLDB_GetEntryByID(c_handle, readWriteVolumeId, -1, &entry, &tst)) {
        goto fail_vos_VolumeRename;
     }
+
     rc = UV_RenameVolume(c_handle, &entry, newVolumeName, &tst);
 
-fail_vos_VolumeRename:
+  fail_vos_VolumeRename:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3184,15 +3101,11 @@ fail_vos_VolumeRename:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VolumeDump(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int *partition,
-  unsigned int volumeId,
-  unsigned int startTime,
-  const char *dumpFile,
-  afs_status_p st)
+int ADMINAPI
+vos_VolumeDump(const void *cellHandle, const void *serverHandle,
+              vos_MessageCallBack_t callBack, unsigned int *partition,
+              unsigned int volumeId, unsigned int startTime,
+              const char *dumpFile, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -3200,7 +3113,7 @@ int ADMINAPI vos_VolumeDump(
     file_server_p f_server = (file_server_p) serverHandle;
     afs_int32 server, part, voltype;
     struct nvldbentry entry;
+
     /*
      * Validate arguments
      */
@@ -3232,8 +3145,8 @@ int ADMINAPI vos_VolumeDump(
            part = *partition;
        }
     } else {
-       if (!GetVolumeInfo(c_handle, volumeId, &entry, &server,
-                          &part, &voltype, &tst)) {
+       if (!GetVolumeInfo
+           (c_handle, volumeId, &entry, &server, &part, &voltype, &tst)) {
            goto fail_vos_VolumeDump;
        }
     }
@@ -3243,13 +3156,13 @@ int ADMINAPI vos_VolumeDump(
        goto fail_vos_VolumeDump;
     }
 
-    rc = UV_DumpVolume(c_handle, volumeId, server, part, startTime,
-                      dumpFile, &tst);
-fail_vos_VolumeDump:
+    rc = UV_DumpVolume(c_handle, volumeId, server, part, startTime, dumpFile,
+                      &tst);
+
+  fail_vos_VolumeDump:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3287,16 +3200,12 @@ fail_vos_VolumeDump:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VolumeRestore(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int partition,
-  unsigned int *volumeId,
-  const char *volumeName,
-  const char *dumpFile,
-  vos_volumeRestoreType_t dumpType,
-  afs_status_p st)
+int ADMINAPI
+vos_VolumeRestore(const void *cellHandle, const void *serverHandle,
+                 vos_MessageCallBack_t callBack, unsigned int partition,
+                 unsigned int *volumeId, char *volumeName,
+                 const char *dumpFile, vos_volumeRestoreType_t dumpType,
+                 afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -3310,7 +3219,7 @@ int ADMINAPI vos_VolumeRestore(
     afs_int32 Oserver, Opart, Otype;
     struct nvldbentry Oentry;
     int equal;
+
     /*
      * Validate arguments
      */
@@ -3343,7 +3252,7 @@ int ADMINAPI vos_VolumeRestore(
      */
 
     if (volumeId != NULL) {
-       if (!VLDB_GetEntryByID(c_handle, *volumeId, -1, &entry, &tst)) {
+       if (!aVLDB_GetEntryByID(c_handle, *volumeId, -1, &entry, &tst)) {
            goto fail_vos_VolumeRestore;
        }
        volid = *volumeId;
@@ -3371,22 +3280,22 @@ int ADMINAPI vos_VolumeRestore(
        close(fd);
     }
 
-    if (!VLDB_GetEntryByName(c_handle, volumeName, &entry, &tst)) {
+    if (!aVLDB_GetEntryByName(c_handle, volumeName, &entry, &tst)) {
        restoreflags = RV_FULLRST;
     } else if (Lp_GetRwIndex(c_handle, &entry, 0) == -1) {
        restoreflags = RV_FULLRST;
        if (volid == 0) {
            volid = entry.volumeId[RWVOL];
-       } else if ((entry.volumeId[RWVOL] != 0) &&
-                  (entry.volumeId[RWVOL] != volid)) {
+       } else if ((entry.volumeId[RWVOL] != 0)
+                  && (entry.volumeId[RWVOL] != volid)) {
            volid = entry.volumeId[RWVOL];
        }
     } else {
 
        if (volid == 0) {
            volid = entry.volumeId[RWVOL];
-       } else if ((entry.volumeId[RWVOL] != 0) &&
-                  (entry.volumeId[RWVOL] != volid)) {
+       } else if ((entry.volumeId[RWVOL] != 0)
+                  && (entry.volumeId[RWVOL] != volid)) {
            volid = entry.volumeId[RWVOL];
        }
 
@@ -3402,8 +3311,8 @@ int ADMINAPI vos_VolumeRestore(
            /*
             * Check to see if the volume exists where the caller said
             */
-           if (!GetVolumeInfo(c_handle, volid, &Oentry, &Oserver, &Opart,
-                              &Otype, &tst)) {
+           if (!GetVolumeInfo
+               (c_handle, volid, &Oentry, &Oserver, &Opart, &Otype, &tst)) {
                goto fail_vos_VolumeRestore;
            }
            if (!VLDB_IsSameAddrs(c_handle, Oserver, server, &equal, &tst)) {
@@ -3420,10 +3329,10 @@ int ADMINAPI vos_VolumeRestore(
     rc = UV_RestoreVolume(c_handle, server, partition, volid, volumeName,
                          restoreflags, dumpFile, &tst);
 
-fail_vos_VolumeRestore:
+  fail_vos_VolumeRestore:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3452,20 +3361,17 @@ fail_vos_VolumeRestore:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VolumeOnline(
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int partition,
-  unsigned int volumeId,
-  unsigned int sleepTime,
-  vos_volumeOnlineType_t volumeStatus,
-  afs_status_p st)
+int ADMINAPI
+vos_VolumeOnline(const void *serverHandle, vos_MessageCallBack_t callBack,
+                unsigned int partition, unsigned int volumeId,
+                unsigned int sleepTime, vos_volumeOnlineType_t volumeStatus,
+                afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     file_server_p f_server = (file_server_p) serverHandle;
     int up = ITOffline;
+
     /*
      * Validate arguments
      */
@@ -3483,13 +3389,13 @@ int ADMINAPI vos_VolumeOnline(
        up = ITBusy;
     }
 
-    rc = UV_SetVolume(f_server->serv, partition, volumeId, up, 0,
-                     sleepTime, &tst);
+    rc = UV_SetVolume(f_server->serv, partition, volumeId, up, 0, sleepTime,
+                     &tst);
 
-fail_vos_VolumeOnline:
+  fail_vos_VolumeOnline:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3518,17 +3424,15 @@ fail_vos_VolumeOnline:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VolumeOffline(
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int partition,
-  unsigned int volumeId,
-  afs_status_p st)
+int ADMINAPI
+vos_VolumeOffline(const void *serverHandle, vos_MessageCallBack_t callBack,
+                 unsigned int partition, unsigned int volumeId,
+                 afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     file_server_p f_server = (file_server_p) serverHandle;
+
     /*
      * Validate arguments
      */
@@ -3544,11 +3448,11 @@ int ADMINAPI vos_VolumeOffline(
 
     rc = UV_SetVolume(f_server->serv, partition, volumeId, ITOffline,
                      VTOutOfService, 0, &tst);
-fail_vos_VolumeOffline:
+
+  fail_vos_VolumeOffline:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3571,10 +3475,9 @@ fail_vos_VolumeOffline:
  * Returns != 0 upon successful completion.
  */
 
-static int copyvolintXInfo(
-    struct volintXInfo *source,
-    vos_volumeEntry_p dest,
-    afs_status_p st)
+static int
+copyvolintXInfo(struct volintXInfo *source, vos_volumeEntry_p dest,
+               afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -3586,43 +3489,43 @@ static int copyvolintXInfo(
      * user from seeing stale data from a previous call
      */
 
-    memset(dest, 0, sizeof(dest));
+    memset(dest, 0, sizeof(*dest));
 
-    switch(source->status){
-      case VOK: 
+    switch (source->status) {
+    case VOK:
        dest->status = VOS_OK;
        break;
-      case VSALVAGE: 
+    case VSALVAGE:
        dest->status = VOS_SALVAGE;
        break;
-      case VNOVNODE: 
+    case VNOVNODE:
        dest->status = VOS_NO_VNODE;
        break;
-      case VNOVOL: 
+    case VNOVOL:
        dest->status = VOS_NO_VOL;
        break;
-      case VVOLEXISTS: 
+    case VVOLEXISTS:
        dest->status = VOS_VOL_EXISTS;
        break;
-      case VNOSERVICE: 
+    case VNOSERVICE:
        dest->status = VOS_NO_SERVICE;
        break;
-      case VOFFLINE: 
+    case VOFFLINE:
        dest->status = VOS_OFFLINE;
        break;
-      case VONLINE: 
+    case VONLINE:
        dest->status = VOS_ONLINE;
        break;
-      case VDISKFULL: 
+    case VDISKFULL:
        dest->status = VOS_DISK_FULL;
        break;
-      case VOVERQUOTA: 
+    case VOVERQUOTA:
        dest->status = VOS_OVER_QUOTA;
        break;
-      case VBUSY: 
+    case VBUSY:
        dest->status = VOS_BUSY;
        break;
-      case VMOVED: 
+    case VMOVED:
        dest->status = VOS_MOVED;
        break;
     }
@@ -3633,7 +3536,8 @@ static int copyvolintXInfo(
      */
 
     if (dest->status == VOS_OK) {
-       strcpy(dest->name, source->name);
+       strncpy(dest->name, source->name, VOS_MAX_VOLUME_NAME_LEN);
+        dest->name[VOS_MAX_VOLUME_NAME_LEN - 1] = '\0';
        dest->id = source->volid;
        if (source->type == 0) {
            dest->type = VOS_READ_WRITE_VOLUME;
@@ -3660,17 +3564,20 @@ static int copyvolintXInfo(
            dest->volumeDisposition = VOS_OFFLINE;
        }
 
-       for(i=0;i<VOS_VOLUME_READ_WRITE_STATS_NUMBER;i++) {
+       for (i = 0; i < VOS_VOLUME_READ_WRITE_STATS_NUMBER; i++) {
            dest->readStats[i] = source->stat_reads[i];
            dest->writeStats[i] = source->stat_writes[i];
        }
 
-       for(i=0;i<VOS_VOLUME_TIME_STATS_NUMBER;i++) {
-           dest->fileAuthorWriteSameNetwork[i] = source->stat_fileSameAuthor[i];
+       for (i = 0; i < VOS_VOLUME_TIME_STATS_NUMBER; i++) {
+           dest->fileAuthorWriteSameNetwork[i] =
+               source->stat_fileSameAuthor[i];
            dest->fileAuthorWriteDifferentNetwork[i] =
                source->stat_fileDiffAuthor[i];
-           dest->dirAuthorWriteSameNetwork[i] = source->stat_dirSameAuthor[i];
-           dest->dirAuthorWriteDifferentNetwork[i] = source->stat_dirDiffAuthor[i];
+           dest->dirAuthorWriteSameNetwork[i] =
+               source->stat_dirSameAuthor[i];
+           dest->dirAuthorWriteDifferentNetwork[i] =
+               source->stat_dirDiffAuthor[i];
        }
     }
 
@@ -3712,20 +3619,17 @@ static int copyvolintXInfo(
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VolumeGet(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int partition,
-  unsigned int volumeId,
-  vos_volumeEntry_p volumeP,
-  afs_status_p st)
+int ADMINAPI
+vos_VolumeGet(const void *cellHandle, const void *serverHandle,
+             vos_MessageCallBack_t callBack, unsigned int partition,
+             unsigned int volumeId, vos_volumeEntry_p volumeP,
+             afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     file_server_p f_server = (file_server_p) serverHandle;
     struct volintXInfo *info = NULL;
+
     /*
      * Validate arguments
      */
@@ -3761,14 +3665,14 @@ int ADMINAPI vos_VolumeGet(
     }
     rc = 1;
 
-fail_vos_VolumeGet:
+  fail_vos_VolumeGet:
 
     if (info != NULL) {
        free(info);
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3778,18 +3682,15 @@ fail_vos_VolumeGet:
  */
 
 typedef struct volume_get {
-  struct volintXInfo *vollist;
-  afs_int32 total; /* total number of volumes at this partition */
-  afs_int32 index; /* index to the current volume */
-  vos_volumeEntry_t entry[CACHED_ITEMS]; /* the cache of entries */
+    struct volintXInfo *vollist;
+    afs_int32 total;           /* total number of volumes at this partition */
+    afs_int32 index;           /* index to the current volume */
+    vos_volumeEntry_t entry[CACHED_ITEMS];     /* the cache of entries */
 } volume_get_t, *volume_get_p;
 
-static int GetVolumeRPC(
-  void *rpc_specific,
-  int slot,
-  int *last_item,
-  int *last_item_contains_data,
-  afs_status_p st)
+static int
+GetVolumeRPC(void *rpc_specific, int slot, int *last_item,
+            int *last_item_contains_data, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -3799,9 +3700,8 @@ static int GetVolumeRPC(
      * Copy the next entry into the cache
      */
 
-    if (!copyvolintXInfo(&entry->vollist[entry->index],
-                        &entry->entry[slot],
-                        &tst)) {
+    if (!copyvolintXInfo
+       (&entry->vollist[entry->index], &entry->entry[slot], &tst)) {
        goto fail_GetVolumeRPC;
     }
     entry->index++;
@@ -3817,7 +3717,7 @@ static int GetVolumeRPC(
     }
     rc = 1;
 
-fail_GetVolumeRPC:
+  fail_GetVolumeRPC:
 
     if (st != NULL) {
        *st = tst;
@@ -3825,17 +3725,14 @@ fail_GetVolumeRPC:
     return rc;
 }
 
-static int GetVolumeFromCache(
-  void *rpc_specific,
-  int slot,
-  void *dest,
-  afs_status_p st)
+static int
+GetVolumeFromCache(void *rpc_specific, int slot, void *dest, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     volume_get_p entry = (volume_get_p) rpc_specific;
 
-    memcpy(dest, (const void *) &entry->entry[slot],
+    memcpy(dest, (const void *)&entry->entry[slot],
           sizeof(vos_volumeEntry_t));
     rc = 1;
 
@@ -3846,9 +3743,8 @@ static int GetVolumeFromCache(
 }
 
 
-static int DestroyVolume(
-  void *rpc_specific,
-  afs_status_p st)
+static int
+DestroyVolume(void *rpc_specific, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -3893,20 +3789,17 @@ static int DestroyVolume(
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VolumeGetBegin(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int partition,
-  void **iterationIdP,
-  afs_status_p st)
+int ADMINAPI
+vos_VolumeGetBegin(const void *cellHandle, const void *serverHandle,
+                  vos_MessageCallBack_t callBack, unsigned int partition,
+                  void **iterationIdP, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     file_server_p f_server = (file_server_p) serverHandle;
-    afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
-    volume_get_p entry = (volume_get_p) calloc(1, sizeof(volume_get_t));
+    afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
+    volume_get_p entry = calloc(1, sizeof(volume_get_t));
+
     /*
      * Validate arguments
      */
@@ -3930,27 +3823,29 @@ int ADMINAPI vos_VolumeGetBegin(
      * server
      */
 
-    if (!UV_XListVolumes(f_server->serv, partition, 1, &entry->vollist,
-                        &entry->total, &tst)) {
+    if (!UV_XListVolumes
+       (f_server->serv, partition, 1, &entry->vollist, &entry->total,
+        &tst)) {
        goto fail_vos_VolumeGetBegin;
     }
 
     if (entry->total == 0) {
-       if (!IteratorInit(iter, (void *) entry, NULL, NULL, NULL, NULL, &tst)) {
+       if (!IteratorInit(iter, (void *)entry, NULL, NULL, NULL, NULL, &tst)) {
            goto fail_vos_VolumeGetBegin;
        }
        iter->done_iterating = 1;
        iter->st = ADMITERATORDONE;
     } else {
-       if (!IteratorInit(iter, (void *) entry, GetVolumeRPC,
-                         GetVolumeFromCache, NULL, DestroyVolume, &tst)) {
+       if (!IteratorInit
+           (iter, (void *)entry, GetVolumeRPC, GetVolumeFromCache, NULL,
+            DestroyVolume, &tst)) {
            goto fail_vos_VolumeGetBegin;
        }
     }
-    *iterationIdP = (void *) iter;
+    *iterationIdP = (void *)iter;
     rc = 1;
 
-fail_vos_VolumeGetBegin:
+  fail_vos_VolumeGetBegin:
 
     if (rc == 0) {
        if (iter != NULL) {
@@ -3962,7 +3857,7 @@ fail_vos_VolumeGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3988,10 +3883,9 @@ fail_vos_VolumeGetBegin:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VolumeGetNext(
-  const void *iterationId,
-  vos_volumeEntry_p volumeP,
-  afs_status_p st)
+int ADMINAPI
+vos_VolumeGetNext(const void *iterationId, vos_volumeEntry_p volumeP,
+                 afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -4007,12 +3901,12 @@ int ADMINAPI vos_VolumeGetNext(
        goto fail_vos_VolumeGetNext;
     }
 
-    rc = IteratorNext(iter, (void *) volumeP, &tst);
-fail_vos_VolumeGetNext:
+    rc = IteratorNext(iter, (void *)volumeP, &tst);
+
+  fail_vos_VolumeGetNext:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -4033,29 +3927,28 @@ fail_vos_VolumeGetNext:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VolumeGetDone(
-  const void *iterationId,
-  afs_status_p st)
+int ADMINAPI
+vos_VolumeGetDone(const void *iterationId, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
+
     /*
      * Validate arguments
      */
+
     if (iter == NULL) {
-        tst = ADMITERATORNULL;
-        goto fail_vos_VolumeGetDone;
+       tst = ADMITERATORNULL;
+       goto fail_vos_VolumeGetDone;
     }
+
     rc = IteratorDone(iter, &tst);
-fail_vos_VolumeGetDone:
+
+  fail_vos_VolumeGetDone:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -4092,26 +3985,23 @@ fail_vos_VolumeGetDone:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VolumeMove(
-  const void *cellHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int volumeId,
-  const void *fromServer,
-  unsigned int fromPartition,
-  const void *toServer,
-  unsigned int toPartition,
-  afs_status_p st)
+int ADMINAPI
+vos_VolumeMove(const void *cellHandle, vos_MessageCallBack_t callBack,
+              unsigned int volumeId, const void *fromServer,
+              unsigned int fromPartition, const void *toServer,
+              unsigned int toPartition, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
     file_server_p from_server = (file_server_p) fromServer;
     file_server_p to_server = (file_server_p) toServer;
-    afs_int32 from_server_addr = ntohl(rx_HostOf(rx_PeerOf(from_server->serv)));
+    afs_int32 from_server_addr =
+       ntohl(rx_HostOf(rx_PeerOf(from_server->serv)));
     afs_int32 to_server_addr = ntohl(rx_HostOf(rx_PeerOf(to_server->serv)));
     afs_int32 from_partition = fromPartition;
     afs_int32 to_partition = toPartition;
+
     /*
      * Validate arguments
      */
@@ -4145,10 +4035,10 @@ int ADMINAPI vos_VolumeMove(
     rc = UV_MoveVolume(c_handle, volumeId, from_server_addr, from_partition,
                       to_server_addr, to_partition, &tst);
 
-fail_vos_VolumeMove:
+  fail_vos_VolumeMove:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -4177,19 +4067,16 @@ fail_vos_VolumeMove:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VolumeRelease(
-  const void *cellHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int volumeId,
-  vos_force_t force,
-  afs_status_p st)
+int ADMINAPI
+vos_VolumeRelease(const void *cellHandle, vos_MessageCallBack_t callBack,
+                 unsigned int volumeId, vos_force_t force, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
     afs_int32 server, part, forc = 0, voltype, volume;
     struct nvldbentry entry;
+
     /*
      * Validate arguments
      */
@@ -4197,9 +4084,9 @@ int ADMINAPI vos_VolumeRelease(
     if (!IsValidCellHandle(c_handle, &tst)) {
        goto fail_vos_VolumeRelease;
     }
-    if (!GetVolumeInfo(c_handle, volumeId, &entry, &server,
-                      &part, &voltype, &tst)) {
+
+    if (!GetVolumeInfo
+       (c_handle, volumeId, &entry, &server, &part, &voltype, &tst)) {
        goto fail_vos_VolumeRelease;
     }
 
@@ -4210,10 +4097,10 @@ int ADMINAPI vos_VolumeRelease(
     volume = volumeId;
     rc = UV_ReleaseVolume(c_handle, volume, server, part, forc, &tst);
 
-fail_vos_VolumeRelease:
+  fail_vos_VolumeRelease:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -4247,20 +4134,16 @@ fail_vos_VolumeRelease:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VolumeZap(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int partition,
-  unsigned int volumeId,
-  vos_force_t force,
-  afs_status_p st)
+int ADMINAPI
+vos_VolumeZap(const void *cellHandle, const void *serverHandle,
+             vos_MessageCallBack_t callBack, unsigned int partition,
+             unsigned int volumeId, vos_force_t force, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
     file_server_p f_server = (file_server_p) serverHandle;
+
     /*
      * Verify that the cellHandle is capable of making vos rpc's
      */
@@ -4270,19 +4153,21 @@ int ADMINAPI vos_VolumeZap(
     }
 
     if (!IsValidServerHandle(f_server, &tst)) {
-        goto fail_vos_VolumeZap;
+       goto fail_vos_VolumeZap;
     }
 
     if (force == VOS_FORCE) {
-       rc = UV_NukeVolume(c_handle, f_server->serv, partition, volumeId, &tst);
+       rc = UV_NukeVolume(c_handle, f_server->serv, partition, volumeId,
+                          &tst);
     } else {
-       rc = UV_VolumeZap(c_handle, f_server->serv, partition, volumeId, &tst);
+       rc = UV_VolumeZap(c_handle, f_server->serv, partition, volumeId,
+                         &tst);
     }
 
-fail_vos_VolumeZap:
+  fail_vos_VolumeZap:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -4308,10 +4193,9 @@ fail_vos_VolumeZap:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_PartitionNameToId(
-  const char *partitionName,
-  unsigned int *partitionId,
-  afs_status_p st)
+int ADMINAPI
+vos_PartitionNameToId(const char *partitionName, unsigned int *partitionId,
+                     afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -4362,7 +4246,7 @@ int ADMINAPI vos_PartitionNameToId(
      * Check that all characters past the prefix are lower case
      */
 
-    for(i=VICE_PREFIX_SIZE;i<partition_name_len;i++) {
+    for (i = VICE_PREFIX_SIZE; i < partition_name_len; i++) {
        if (!islower(partitionName[i])) {
            tst = ADMVOSPARTITIONNAMENOTLOWER;
            goto fail_vos_PartitionNameToId;
@@ -4376,8 +4260,9 @@ int ADMINAPI vos_PartitionNameToId(
     if (partitionName[VICE_PREFIX_SIZE + 1] == 0) {
        *partitionId = partitionName[VICE_PREFIX_SIZE] - 'a';
     } else {
-       *partitionId = (partitionName[VICE_PREFIX_SIZE] - 'a') * 26  +
-                      (partitionName[VICE_PREFIX_SIZE + 1] - 'a') + 26;
+       *partitionId =
+           (partitionName[VICE_PREFIX_SIZE] - 'a') * 26 +
+           (partitionName[VICE_PREFIX_SIZE + 1] - 'a') + 26;
     }
 
     if (*partitionId > VOLMAXPARTS) {
@@ -4386,10 +4271,10 @@ int ADMINAPI vos_PartitionNameToId(
     }
     rc = 1;
 
-fail_vos_PartitionNameToId:
+  fail_vos_PartitionNameToId:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -4414,10 +4299,9 @@ fail_vos_PartitionNameToId:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_PartitionIdToName(
-  unsigned int partitionId,
-  char *partitionName,
-  afs_status_p st)
+int ADMINAPI
+vos_PartitionIdToName(unsigned int partitionId, char *partitionName,
+                     afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -4432,23 +4316,23 @@ int ADMINAPI vos_PartitionIdToName(
        goto fail_vos_PartitionIdToName;
     }
 
-    if(partitionId < 26) {
+    if (partitionId < 26) {
        strcpy(partitionName, VICE_PARTITION_PREFIX);
        partitionName[6] = partitionId + 'a';
        partitionName[7] = '\0';
     } else {
        strcpy(partitionName, VICE_PARTITION_PREFIX);
        partitionId -= 26;
-       partitionName[6] = 'a' + (partitionId/26);
-       partitionName[7] = 'a' + (partitionId%26);
+       partitionName[6] = 'a' + (partitionId / 26);
+       partitionName[7] = 'a' + (partitionId % 26);
        partitionName[8] = '\0';
     }
     rc = 1;
 
-fail_vos_PartitionIdToName:
+  fail_vos_PartitionIdToName:
+
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -4482,14 +4366,11 @@ fail_vos_PartitionIdToName:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI vos_VolumeQuotaChange(
-  const void *cellHandle,
-  const void *serverHandle,
-  vos_MessageCallBack_t callBack,
-  unsigned int partition,
-  unsigned int volumeId,
-  unsigned int volumeQuota,
-  afs_status_p st)
+int ADMINAPI
+vos_VolumeQuotaChange(const void *cellHandle, const void *serverHandle,
+                     vos_MessageCallBack_t callBack, unsigned int partition,
+                     unsigned int volumeId, unsigned int volumeQuota,
+                     afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -4509,14 +4390,17 @@ int ADMINAPI vos_VolumeQuotaChange(
     }
 
     if (!IsValidServerHandle(f_server, &tst)) {
-        goto fail_vos_VolumeQuotaChange;
+       goto fail_vos_VolumeQuotaChange;
     }
 
-    memset((void *) &tstatus, 0, sizeof(tstatus));
+    memset((void *)&tstatus, 0, sizeof(tstatus));
     tstatus.dayUse = -1;
+    tstatus.spare2 = -1;
     tstatus.maxquota = volumeQuota;
 
-    tst = AFSVolTransCreate(f_server->serv, volumeId, partition, ITBusy, &ttid);
+
+    tst =
+       AFSVolTransCreate(f_server->serv, volumeId, partition, ITBusy, &ttid);
     if (tst) {
        goto fail_vos_VolumeQuotaChange;
     }
@@ -4528,7 +4412,190 @@ int ADMINAPI vos_VolumeQuotaChange(
     }
     rc = 1;
 
-fail_vos_VolumeQuotaChange:
+  fail_vos_VolumeQuotaChange:
+
+    if (active_trans) {
+       afs_status_t tst2 = 0;
+       tst2 = AFSVolEndTrans(f_server->serv, ttid, &rcode);
+       if (tst2) {
+           if (tst == 0) {
+               tst = tst2;
+               rc = 0;
+           }
+       }
+       if (rcode) {
+           if (tst == 0) {
+               tst = rcode;
+               rc = 0;
+           }
+       }
+    }
+
+    if (st != NULL) {
+       *st = tst;
+    }
+    return rc;
+}
+/*
+ * vos_VolumeGet2 - get information about a particular volume.
+ *
+ * PARAMETERS
+ *
+ * IN cellHandle - a previously opened cellHandle that corresponds
+ * to the cell where the volume exists.
+ *
+ * IN serverHandle - a previously opened serverHandle that corresponds
+ * to the server where the volume exists.
+ *
+ * IN callBack - a call back function pointer that may be called to report
+ * status information.  Can be null.
+ *
+ * IN partition - the partition where the volume exists.
+ *
+ * IN volumeId - the volume id of the volume to be retrieved.
+ *
+ * OUT pinfo - upon successful completion, contains the information about the 
+ * specified volume.
+ *
+ * LOCKS
+ * 
+ * No locks are obtained or released by this function
+ *
+ * RETURN CODES
+ *
+ * Returns != 0 upon successful completion.
+ */
+
+int ADMINAPI
+vos_VolumeGet2(const void *cellHandle, const void *serverHandle,
+             vos_MessageCallBack_t callBack, unsigned int partition,
+             unsigned int volumeId, volintInfo* pinfo,
+             afs_status_p st)
+{
+    int rc = 0;
+    afs_status_t tst = 0;
+    file_server_p f_server = (file_server_p) serverHandle;
+    volintInfo *pinfo_=0;
+
+    /*
+     * Validate arguments
+     */
+
+    if (!IsValidServerHandle(f_server, &tst)) {
+       goto fail_vos_VolumeGet2;
+    }
+
+    if (partition > VOLMAXPARTS) {
+       tst = ADMVOSPARTITIONIDTOOLARGE;
+       goto fail_vos_VolumeGet2;
+    }
+
+    if (pinfo == NULL) {
+       tst = ADMVOSVOLUMEPNULL;
+       goto fail_vos_VolumeGet2;
+    }
+
+    /*
+     * Retrieve the information for the volume
+     */
+
+    if (!UV_ListOneVolume(f_server->serv, partition, volumeId, &pinfo_,&tst)) {
+       goto fail_vos_VolumeGet2;
+    }
+
+
+    rc = 1;
+
+  fail_vos_VolumeGet2:
+
+    if (pinfo_ != NULL) {
+     memcpy(pinfo,pinfo_,sizeof(volintInfo));
+       free(pinfo_);
+    }
+
+    if (st != NULL) {
+       *st = tst;
+    }
+    return rc;
+}
+
+/*
+ * vos_ClearVolUpdateCounter - reset volUpdateCounter of a volume to zero
+ *
+ * PARAMETERS
+ *
+ * IN cellHandle - a previously opened cellHandle that corresponds
+ * to the cell where the volume exists.
+ *
+ * IN serverHandle - a previously opened serverHandle that corresponds
+ * to the server where the volume exists.
+ *
+ * IN partition - the partition where the volume exists.
+ *
+ * IN volumeId - the volume id of the volume to be retrieved.
+ *
+ * LOCKS
+ * 
+ * No locks are obtained or released by this function
+ *
+ * RETURN CODES
+ *
+ * Returns != 0 upon successful completion.
+ */
+
+int ADMINAPI
+vos_ClearVolUpdateCounter(const void *cellHandle,
+                                 const void *serverHandle,
+                                 unsigned int partition,
+                                 unsigned int volumeId,
+                                 afs_status_p st)
+{
+    int rc = 0;
+    afs_status_t tst = 0;
+    afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
+    file_server_p f_server = (file_server_p) serverHandle;
+    int ttid = 0;
+    int rcode = 0;
+    struct volintInfo tstatus;
+    int active_trans = 0;
+
+    /*
+     * Verify that the cellHandle is capable of making vos rpc's
+     */
+
+    if (!IsValidCellHandle(c_handle, &tst)) {
+       goto fail_vos_ClearVolUpdateCounter;
+    }
+
+    if (!IsValidServerHandle(f_server, &tst)) {
+       goto fail_vos_ClearVolUpdateCounter;
+    }
+
+    memset((void *)&tstatus, 0, sizeof(tstatus));
+    tstatus.maxquota = -1;
+    tstatus.dayUse = -1;
+    tstatus.creationDate = -1;
+    tstatus.updateDate = -1;
+    tstatus.flags = -1;
+    tstatus.spare0 = -1;
+    tstatus.spare1 = -1;
+    tstatus.spare2 = 0;
+    tstatus.spare3 = -1;
+    
+    tst =
+       AFSVolTransCreate(f_server->serv, volumeId, partition, ITBusy, &ttid);
+    if (tst) {
+       goto fail_vos_ClearVolUpdateCounter;
+    }
+    active_trans = 1;
+
+    tst = AFSVolSetInfo(f_server->serv, ttid, &tstatus);
+    if (tst) {
+       goto fail_vos_ClearVolUpdateCounter;
+    }
+    rc = 1;
+
+  fail_vos_ClearVolUpdateCounter:
 
     if (active_trans) {
        afs_status_t tst2 = 0;
@@ -4548,7 +4615,7 @@ fail_vos_VolumeQuotaChange:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }