Don't cast the return from calloc()
[openafs.git] / src / libadmin / vos / afs_vosAdmin.c
index 3256a95..3eba22c 100644 (file)
@@ -7,43 +7,39 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-#include <afs/param.h>
 #include <afsconfig.h>
+#include <afs/param.h>
 #include <afs/stds.h>
-#include <stdio.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#else
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#endif
+
+#include <roken.h>
+
 #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/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;
@@ -67,34 +63,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;
@@ -117,14 +112,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;
     }
 
@@ -134,7 +128,7 @@ static int IsValidCellHandle(
     }
     rc = 1;
 
-fail_IsValidCellHandle:
+  fail_IsValidCellHandle:
 
     if (st != NULL) {
        *st = tst;
@@ -144,37 +138,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 = ITSRWVOL;
+       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 = ITSROVOL;
+       /* 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;
@@ -202,11 +193,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;
@@ -220,7 +209,7 @@ int ADMINAPI vos_BackupVolumeCreate(
     afs_int32 bk_partition;
     afs_int32 bk_vol_type;
     int equal;
+
     /*
      * Validate arguments
      */
@@ -234,8 +223,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;
     }
 
@@ -250,9 +240,9 @@ int ADMINAPI vos_BackupVolumeCreate(
      */
 
     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 (!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)) {
@@ -270,10 +260,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;
 }
@@ -309,14 +299,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;
@@ -328,14 +317,14 @@ 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((void *)&attr, 0, sizeof(attr));
 
     /*
      * Validate arguments
@@ -349,8 +338,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;
     }
@@ -381,7 +370,7 @@ int ADMINAPI vos_BackupVolumeCreateMultiple(
        prefix_len = strlen(volumePrefix);
     }
 
-    memset((void *) &arrayEntries, 0, sizeof(arrayEntries));
+    memset((void *)&arrayEntries, 0, sizeof(arrayEntries));
 
     /*
      * Get a list of all the volumes in the cell
@@ -396,7 +385,7 @@ 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];
 
        /*
@@ -406,10 +395,10 @@ int ADMINAPI vos_BackupVolumeCreateMultiple(
        if (!(entry->flags & RW_EXISTS)) {
            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;
@@ -438,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;
@@ -453,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;
@@ -471,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;
@@ -497,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;
 }
@@ -540,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;
     }
@@ -575,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;
 }
@@ -595,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
@@ -627,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;
     }
 
@@ -642,7 +627,7 @@ static int GetPartitionInfoRPC(
     }
     rc = 1;
 
-fail_GetPartitionInfoRPC:
+  fail_GetPartitionInfoRPC:
 
     if (st != NULL) {
        *st = tst;
@@ -650,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;
 
@@ -696,34 +679,33 @@ 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 =
+       (afs_admin_iterator_p) 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;
     }
 
     /*
@@ -731,8 +713,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;
     }
 
@@ -742,21 +724,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) {
@@ -768,7 +751,7 @@ fail_vos_PartitionGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -792,10 +775,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;
@@ -811,12 +793,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;
 }
@@ -837,29 +819,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;
 }
@@ -887,11 +868,9 @@ 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;
@@ -902,8 +881,8 @@ int ADMINAPI vos_ServerOpen(
     int scIndex;
 
     if (f_server == NULL) {
-        tst = ADMNOMEM;
-        goto fail_vos_ServerOpen;
+       tst = ADMNOMEM;
+       goto fail_vos_ServerOpen;
     }
 
     /*
@@ -919,31 +898,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;
 }
@@ -964,14 +944,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;
     }
@@ -981,10 +960,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;
 }
@@ -1016,12 +995,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;
@@ -1029,7 +1006,7 @@ int ADMINAPI vos_ServerSync(
     file_server_p f_server = (file_server_p) serverHandle;
     afs_int32 part = 0;
     int flags = 0;
+
     /*
      * Validate arguments
      */
@@ -1047,7 +1024,7 @@ int ADMINAPI vos_ServerSync(
            tst = ADMVOSPARTITIONTOOLARGE;
            goto fail_vos_ServerSync;
        }
-       part = (afs_int32) *partition;
+       part = (afs_int32) * partition;
        flags = 1;
     }
 
@@ -1056,11 +1033,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;
 }
@@ -1089,17 +1066,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
      */
@@ -1108,17 +1084,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;
 }
@@ -1145,17 +1121,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
      */
@@ -1164,17 +1140,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;
 }
@@ -1189,19 +1166,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;
@@ -1219,27 +1193,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;
            }
@@ -1249,14 +1222,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];
            }
 
@@ -1265,9 +1238,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;
@@ -1286,7 +1259,7 @@ static int GetServerRPC(
     }
     rc = 1;
 
-fail_GetServerRPC:
+  fail_GetServerRPC:
 
     if (st != NULL) {
        *st = tst;
@@ -1294,17 +1267,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;
 
@@ -1315,9 +1285,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;
@@ -1357,19 +1326,18 @@ 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 =
+       (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
+    server_get_p serv = calloc(1, sizeof(server_get_t));
     struct VLCallBack unused;
+
 
     /*
      * Validate arguments
@@ -1380,12 +1348,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;
     }
 
     /*
@@ -1393,8 +1361,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;
@@ -1405,24 +1374,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) {
@@ -1437,7 +1407,7 @@ fail_vos_FileServerGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1462,10 +1432,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;
@@ -1481,12 +1450,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;
 }
@@ -1507,29 +1476,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;
 }
@@ -1539,18 +1507,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;
@@ -1575,38 +1540,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;
     }
 
@@ -1636,17 +1600,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;
 
@@ -1657,9 +1619,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;
@@ -1702,19 +1663,19 @@ 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 =
+       (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
+    transaction_get_p tran = calloc(1, sizeof(transaction_get_t));
+
 
     /*
      * Validate arguments
@@ -1725,12 +1686,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;
     }
 
     /*
@@ -1742,23 +1703,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) {
@@ -1773,7 +1733,7 @@ fail_vos_ServerTransactionStatusGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1800,10 +1760,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;
@@ -1819,12 +1779,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;
 }
@@ -1846,52 +1806,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;
        }
@@ -1918,8 +1875,9 @@ 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;
@@ -1939,7 +1897,7 @@ static int copyVLDBEntry(
        if (source->serverFlags[i] & RO_DONTUSE) {
            dest->volumeSites[i].serverFlags |= VOS_VLDB_DONT_USE;
        }
-       
+
     }
 
     rc = 1;
@@ -1976,19 +1934,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
@@ -2003,8 +1958,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;
     }
@@ -2017,11 +1971,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;
        }
     }
@@ -2034,11 +1988,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;
 }
@@ -2048,18 +2002,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;
@@ -2069,9 +2020,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++;
@@ -2087,7 +2038,7 @@ static int GetVLDBEntryRPC(
     }
     rc = 1;
 
-fail_GetVLDBEntryRPC:
+  fail_GetVLDBEntryRPC:
 
     if (st != NULL) {
        *st = tst;
@@ -2095,18 +2046,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) {
@@ -2116,9 +2064,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;
@@ -2165,20 +2112,18 @@ 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 =
+       (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
+    vldb_entry_get_p entry = calloc(1, sizeof(vldb_entry_get_t));
     struct VldbListByAttributes attr;
 
     attr.Mask = 0;
@@ -2214,28 +2159,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) {
@@ -2250,7 +2195,7 @@ fail_vos_VLDBGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2276,10 +2221,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;
@@ -2295,12 +2239,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;
 }
@@ -2321,29 +2265,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;
 }
@@ -2375,13 +2318,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;
@@ -2391,7 +2332,7 @@ int ADMINAPI vos_VLDBEntryRemove(
     nbulkentries entries;
     afs_int32 nentries;
     int i;
+
     memset(&attr, 0, sizeof(attr));
     memset(&entries, 0, sizeof(entries));
 
@@ -2408,7 +2349,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;
        }
@@ -2445,23 +2386,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.
  *
@@ -2487,12 +2429,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;
@@ -2543,20 +2483,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;
 }
@@ -2584,11 +2525,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;
@@ -2602,16 +2541,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;
 }
@@ -2638,11 +2577,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;
@@ -2657,17 +2594,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;
 }
@@ -2699,19 +2637,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
      */
@@ -2729,16 +2665,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;
 }
@@ -2771,19 +2708,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
      */
@@ -2801,16 +2736,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;
 }
@@ -2842,13 +2778,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;
@@ -2857,7 +2790,7 @@ int ADMINAPI vos_VLDBSync(
     afs_int32 part = 0;
     int flags = 0;
     int force_flag = 0;
+
     /*
      * Validate arguments
      */
@@ -2875,7 +2808,7 @@ int ADMINAPI vos_VLDBSync(
            tst = ADMVOSPARTITIONTOOLARGE;
            goto fail_vos_VLDBSync;
        }
-       part = (afs_int32) *partition;
+       part = (afs_int32) * partition;
        flags = 1;
     }
 
@@ -2888,11 +2821,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;
 }
@@ -2929,15 +2862,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;
@@ -2945,7 +2874,7 @@ int ADMINAPI vos_VolumeCreate(
     file_server_p f_server = (file_server_p) serverHandle;
     vos_partitionEntry_t pinfo;
     struct nvldbentry vinfo;
+
     /*
      * Validate arguments
      */
@@ -2976,8 +2905,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;
     }
 
@@ -2985,7 +2914,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;
     }
@@ -2994,13 +2923,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;
 }
@@ -3032,20 +2961,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
      */
@@ -3067,17 +2993,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;
 }
@@ -3109,18 +3035,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
      */
@@ -3138,16 +3062,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;
 }
@@ -3181,15 +3105,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;
@@ -3197,7 +3117,7 @@ int ADMINAPI vos_VolumeDump(
     file_server_p f_server = (file_server_p) serverHandle;
     afs_int32 server, part, voltype;
     struct nvldbentry entry;
+
     /*
      * Validate arguments
      */
@@ -3229,8 +3149,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;
        }
     }
@@ -3240,13 +3160,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;
 }
@@ -3284,16 +3204,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;
@@ -3307,7 +3223,7 @@ int ADMINAPI vos_VolumeRestore(
     afs_int32 Oserver, Opart, Otype;
     struct nvldbentry Oentry;
     int equal;
+
     /*
      * Validate arguments
      */
@@ -3340,7 +3256,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;
@@ -3368,22 +3284,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];
        }
 
@@ -3399,8 +3315,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)) {
@@ -3417,10 +3333,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;
 }
@@ -3449,20 +3365,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
      */
@@ -3480,13 +3393,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;
 }
@@ -3515,17 +3428,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
      */
@@ -3541,11 +3452,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;
 }
@@ -3568,10 +3479,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;
@@ -3583,43 +3493,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;
     }
@@ -3630,7 +3540,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;
@@ -3657,17 +3568,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];
        }
     }
 
@@ -3709,20 +3623,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
      */
@@ -3758,14 +3669,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;
 }
@@ -3775,18 +3686,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;
@@ -3796,9 +3704,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++;
@@ -3814,7 +3721,7 @@ static int GetVolumeRPC(
     }
     rc = 1;
 
-fail_GetVolumeRPC:
+  fail_GetVolumeRPC:
 
     if (st != NULL) {
        *st = tst;
@@ -3822,17 +3729,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;
 
@@ -3843,9 +3747,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;
@@ -3890,20 +3793,18 @@ 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 =
+       (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
+    volume_get_p entry = calloc(1, sizeof(volume_get_t));
+
     /*
      * Validate arguments
      */
@@ -3927,27 +3828,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) {
@@ -3959,7 +3862,7 @@ fail_vos_VolumeGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3985,10 +3888,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;
@@ -4004,12 +3906,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;
 }
@@ -4030,29 +3932,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;
 }
@@ -4089,26 +3990,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
      */
@@ -4142,10 +4040,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;
 }
@@ -4174,19 +4072,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
      */
@@ -4194,9 +4089,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;
     }
 
@@ -4207,10 +4102,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;
 }
@@ -4244,20 +4139,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
      */
@@ -4267,19 +4158,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;
 }
@@ -4305,10 +4198,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;
@@ -4359,7 +4251,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;
@@ -4373,8 +4265,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) {
@@ -4383,10 +4276,10 @@ int ADMINAPI vos_PartitionNameToId(
     }
     rc = 1;
 
-fail_vos_PartitionNameToId:
+  fail_vos_PartitionNameToId:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -4411,10 +4304,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;
@@ -4429,23 +4321,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;
 }
@@ -4479,14 +4371,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;
@@ -4506,14 +4395,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;
     }
@@ -4525,7 +4417,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;
@@ -4545,7 +4620,7 @@ fail_vos_VolumeQuotaChange:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }