libadmin: Clear structures according to their size.
[openafs.git] / src / libadmin / vos / afs_vosAdmin.c
index c8558a7..80846fd 100644 (file)
@@ -7,42 +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_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#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;
@@ -66,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;
@@ -116,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;
     }
 
@@ -133,7 +128,7 @@ static int IsValidCellHandle(
     }
     rc = 1;
 
-fail_IsValidCellHandle:
+  fail_IsValidCellHandle:
 
     if (st != NULL) {
        *st = tst;
@@ -143,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;
@@ -201,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;
@@ -219,7 +209,7 @@ int ADMINAPI vos_BackupVolumeCreate(
     afs_int32 bk_partition;
     afs_int32 bk_vol_type;
     int equal;
+
     /*
      * Validate arguments
      */
@@ -233,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;
     }
 
@@ -249,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)) {
@@ -269,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;
 }
@@ -308,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;
@@ -327,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
@@ -348,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;
     }
@@ -380,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
@@ -395,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];
 
        /*
@@ -405,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;
@@ -437,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;
@@ -452,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;
@@ -470,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;
@@ -496,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;
 }
@@ -539,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;
     }
@@ -574,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;
 }
@@ -594,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
@@ -626,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;
     }
 
@@ -641,7 +627,7 @@ static int GetPartitionInfoRPC(
     }
     rc = 1;
 
-fail_GetPartitionInfoRPC:
+  fail_GetPartitionInfoRPC:
 
     if (st != NULL) {
        *st = tst;
@@ -649,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;
 
@@ -695,34 +679,34 @@ 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 =
+       (partition_get_p) 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;
     }
 
     /*
@@ -730,8 +714,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;
     }
 
@@ -741,21 +725,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) {
@@ -767,7 +752,7 @@ fail_vos_PartitionGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -791,10 +776,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;
@@ -810,12 +794,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;
 }
@@ -836,29 +820,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;
 }
@@ -886,11 +869,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;
@@ -901,8 +882,8 @@ int ADMINAPI vos_ServerOpen(
     int scIndex;
 
     if (f_server == NULL) {
-        tst = ADMNOMEM;
-        goto fail_vos_ServerOpen;
+       tst = ADMNOMEM;
+       goto fail_vos_ServerOpen;
     }
 
     /*
@@ -918,31 +899,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;
 }
@@ -963,14 +945,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;
     }
@@ -980,10 +961,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;
 }
@@ -1015,12 +996,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;
@@ -1028,7 +1007,7 @@ int ADMINAPI vos_ServerSync(
     file_server_p f_server = (file_server_p) serverHandle;
     afs_int32 part = 0;
     int flags = 0;
+
     /*
      * Validate arguments
      */
@@ -1046,7 +1025,7 @@ int ADMINAPI vos_ServerSync(
            tst = ADMVOSPARTITIONTOOLARGE;
            goto fail_vos_ServerSync;
        }
-       part = (afs_int32) *partition;
+       part = (afs_int32) * partition;
        flags = 1;
     }
 
@@ -1055,11 +1034,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;
 }
@@ -1088,17 +1067,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
      */
@@ -1107,17 +1085,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;
 }
@@ -1144,17 +1122,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
      */
@@ -1163,17 +1141,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;
 }
@@ -1188,19 +1167,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;
@@ -1218,27 +1194,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;
            }
@@ -1248,14 +1223,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];
            }
 
@@ -1264,9 +1239,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;
@@ -1285,7 +1260,7 @@ static int GetServerRPC(
     }
     rc = 1;
 
-fail_GetServerRPC:
+  fail_GetServerRPC:
 
     if (st != NULL) {
        *st = tst;
@@ -1293,17 +1268,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;
 
@@ -1314,9 +1286,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;
@@ -1356,19 +1327,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));
+    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));
     struct VLCallBack unused;
+
 
     /*
      * Validate arguments
@@ -1379,12 +1349,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;
     }
 
     /*
@@ -1392,8 +1362,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;
@@ -1404,24 +1375,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) {
@@ -1436,7 +1408,7 @@ fail_vos_FileServerGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1461,10 +1433,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;
@@ -1480,12 +1451,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;
 }
@@ -1506,29 +1477,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;
 }
@@ -1538,18 +1508,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;
@@ -1574,38 +1541,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;
     }
 
@@ -1635,17 +1601,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;
 
@@ -1656,9 +1620,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;
@@ -1701,19 +1664,20 @@ 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 =
+       (transaction_get_p) calloc(1, sizeof(transaction_get_t));
+
 
     /*
      * Validate arguments
@@ -1724,12 +1688,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;
     }
 
     /*
@@ -1741,23 +1705,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) {
@@ -1772,7 +1735,7 @@ fail_vos_ServerTransactionStatusGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1799,10 +1762,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;
@@ -1818,12 +1781,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;
 }
@@ -1845,52 +1808,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;
        }
@@ -1917,8 +1877,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;
@@ -1938,7 +1899,7 @@ static int copyVLDBEntry(
        if (source->serverFlags[i] & RO_DONTUSE) {
            dest->volumeSites[i].serverFlags |= VOS_VLDB_DONT_USE;
        }
-       
+
     }
 
     rc = 1;
@@ -1975,19 +1936,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
@@ -2002,8 +1960,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;
     }
@@ -2016,11 +1973,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;
        }
     }
@@ -2033,11 +1990,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;
 }
@@ -2047,18 +2004,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;
@@ -2068,9 +2022,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++;
@@ -2086,7 +2040,7 @@ static int GetVLDBEntryRPC(
     }
     rc = 1;
 
-fail_GetVLDBEntryRPC:
+  fail_GetVLDBEntryRPC:
 
     if (st != NULL) {
        *st = tst;
@@ -2094,18 +2048,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) {
@@ -2115,9 +2066,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;
@@ -2164,20 +2114,19 @@ 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 =
+       (vldb_entry_get_p) calloc(1, sizeof(vldb_entry_get_t));
     struct VldbListByAttributes attr;
 
     attr.Mask = 0;
@@ -2213,28 +2162,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) {
@@ -2249,7 +2198,7 @@ fail_vos_VLDBGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2275,10 +2224,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;
@@ -2294,12 +2242,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;
 }
@@ -2320,29 +2268,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;
 }
@@ -2374,13 +2321,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;
@@ -2390,7 +2335,7 @@ int ADMINAPI vos_VLDBEntryRemove(
     nbulkentries entries;
     afs_int32 nentries;
     int i;
+
     memset(&attr, 0, sizeof(attr));
     memset(&entries, 0, sizeof(entries));
 
@@ -2407,7 +2352,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;
        }
@@ -2444,23 +2389,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.
  *
@@ -2486,12 +2432,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;
@@ -2542,20 +2486,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;
 }
@@ -2583,11 +2528,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;
@@ -2601,16 +2544,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;
 }
@@ -2637,11 +2580,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;
@@ -2656,17 +2597,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;
 }
@@ -2698,19 +2640,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
      */
@@ -2728,16 +2668,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;
 }
@@ -2770,19 +2711,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
      */
@@ -2800,16 +2739,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;
 }
@@ -2841,13 +2781,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;
@@ -2856,7 +2793,7 @@ int ADMINAPI vos_VLDBSync(
     afs_int32 part = 0;
     int flags = 0;
     int force_flag = 0;
+
     /*
      * Validate arguments
      */
@@ -2874,7 +2811,7 @@ int ADMINAPI vos_VLDBSync(
            tst = ADMVOSPARTITIONTOOLARGE;
            goto fail_vos_VLDBSync;
        }
-       part = (afs_int32) *partition;
+       part = (afs_int32) * partition;
        flags = 1;
     }
 
@@ -2887,11 +2824,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;
 }
@@ -2928,15 +2865,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;
@@ -2944,7 +2877,7 @@ int ADMINAPI vos_VolumeCreate(
     file_server_p f_server = (file_server_p) serverHandle;
     vos_partitionEntry_t pinfo;
     struct nvldbentry vinfo;
+
     /*
      * Validate arguments
      */
@@ -2975,8 +2908,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;
     }
 
@@ -2984,7 +2917,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;
     }
@@ -2993,13 +2926,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;
 }
@@ -3031,20 +2964,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
      */
@@ -3066,17 +2996,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;
 }
@@ -3108,18 +3038,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
      */
@@ -3137,16 +3065,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;
 }
@@ -3180,15 +3108,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;
@@ -3196,7 +3120,7 @@ int ADMINAPI vos_VolumeDump(
     file_server_p f_server = (file_server_p) serverHandle;
     afs_int32 server, part, voltype;
     struct nvldbentry entry;
+
     /*
      * Validate arguments
      */
@@ -3228,8 +3152,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;
        }
     }
@@ -3239,13 +3163,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;
 }
@@ -3283,16 +3207,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;
@@ -3306,7 +3226,7 @@ int ADMINAPI vos_VolumeRestore(
     afs_int32 Oserver, Opart, Otype;
     struct nvldbentry Oentry;
     int equal;
+
     /*
      * Validate arguments
      */
@@ -3339,7 +3259,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;
@@ -3367,22 +3287,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];
        }
 
@@ -3398,8 +3318,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)) {
@@ -3416,10 +3336,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;
 }
@@ -3448,20 +3368,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
      */
@@ -3479,13 +3396,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;
 }
@@ -3514,17 +3431,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
      */
@@ -3540,11 +3455,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;
 }
@@ -3567,10 +3482,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;
@@ -3582,43 +3496,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;
     }
@@ -3629,7 +3543,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;
@@ -3656,17 +3571,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];
        }
     }
 
@@ -3708,20 +3626,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
      */
@@ -3757,14 +3672,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;
 }
@@ -3774,18 +3689,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;
@@ -3795,9 +3707,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++;
@@ -3813,7 +3724,7 @@ static int GetVolumeRPC(
     }
     rc = 1;
 
-fail_GetVolumeRPC:
+  fail_GetVolumeRPC:
 
     if (st != NULL) {
        *st = tst;
@@ -3821,17 +3732,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;
 
@@ -3842,9 +3750,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;
@@ -3889,20 +3796,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));
+    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));
+
     /*
      * Validate arguments
      */
@@ -3926,27 +3831,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) {
@@ -3958,7 +3865,7 @@ fail_vos_VolumeGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3984,10 +3891,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;
@@ -4003,12 +3909,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;
 }
@@ -4029,29 +3935,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;
 }
@@ -4088,26 +3993,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
      */
@@ -4141,10 +4043,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;
 }
@@ -4173,19 +4075,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
      */
@@ -4193,9 +4092,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;
     }
 
@@ -4206,10 +4105,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;
 }
@@ -4243,20 +4142,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
      */
@@ -4266,19 +4161,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;
 }
@@ -4304,10 +4201,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;
@@ -4358,7 +4254,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;
@@ -4372,8 +4268,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) {
@@ -4382,10 +4279,10 @@ int ADMINAPI vos_PartitionNameToId(
     }
     rc = 1;
 
-fail_vos_PartitionNameToId:
+  fail_vos_PartitionNameToId:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -4410,10 +4307,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;
@@ -4428,23 +4324,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;
 }
@@ -4478,14 +4374,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;
@@ -4505,14 +4398,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;
     }
@@ -4524,7 +4420,7 @@ int ADMINAPI vos_VolumeQuotaChange(
     }
     rc = 1;
 
-fail_vos_VolumeQuotaChange:
+  fail_vos_VolumeQuotaChange:
 
     if (active_trans) {
        afs_status_t tst2 = 0;
@@ -4544,7 +4440,190 @@ fail_vos_VolumeQuotaChange:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *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;
+       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;
 }