vos: Cleanup function definitions
[openafs.git] / src / volser / vos.c
index 638c987..e216445 100644 (file)
@@ -58,8 +58,8 @@
 #endif
 
 /* Local Prototypes */
-int PrintDiagnostics(char *astring, afs_int32 acode);
-int GetVolumeInfo(afs_uint32 volid, afs_uint32 *server, afs_int32 *part,
+static int PrintDiagnostics(char *astring, afs_int32 acode);
+static int GetVolumeInfo(afs_uint32 volid, afs_uint32 *server, afs_int32 *part,
                  afs_int32 *voltype, struct nvldbentry *rentry);
 
 struct tqElem {
@@ -209,7 +209,7 @@ IsNumeric(char *name)
 /*
  * Parse a server dotted address and return the address in network byte order
  */
-afs_uint32
+static afs_uint32
 GetServerNoresolve(char *aname)
 {
     int b1, b2, b3, b4;
@@ -227,7 +227,7 @@ GetServerNoresolve(char *aname)
 /*
  * Parse a server name/address and return a non-loopback address in network byte order
  */
-afs_uint32
+static afs_uint32
 GetServer(char *aname)
 {
     struct hostent *th;
@@ -283,21 +283,7 @@ GetServer(char *aname)
     return 0;
 }
 
-afs_int32
-GetVolumeType(char *aname)
-{
-
-    if (!strcmp(aname, "ro"))
-       return (ROVOL);
-    else if (!strcmp(aname, "rw"))
-       return (RWVOL);
-    else if (!strcmp(aname, "bk"))
-       return (BACKVOL);
-    else
-       return (-1);
-}
-
-int
+static int
 IsPartValid(afs_int32 partId, afs_uint32 server, afs_int32 *code)
 {
     struct partList dummyPartList;
@@ -319,7 +305,7 @@ IsPartValid(afs_int32 partId, afs_uint32 server, afs_int32 *code)
 
  /*sends the contents of file associated with <fd> and <blksize>  to Rx Stream
   * associated  with <call> */
-int
+static int
 SendFile(usd_handle_t ufd, struct rx_call *call, long blksize)
 {
     char *buffer = (char *)0;
@@ -365,7 +351,7 @@ SendFile(usd_handle_t ufd, struct rx_call *call, long blksize)
 
 /* function invoked by UV_RestoreVolume, reads the data from rx_trx_stream and
  * writes it out to the volume. */
-afs_int32
+static afs_int32
 WriteData(struct rx_call *call, void *rock)
 {
     char *filename = (char *) rock;
@@ -427,7 +413,7 @@ WriteData(struct rx_call *call, void *rock)
 /* Receive data from <call> stream into file associated
  * with <fd> <blksize>
  */
-int
+static int
 ReceiveFile(usd_handle_t ufd, struct rx_call *call, long blksize)
 {
     char *buffer = NULL;
@@ -469,7 +455,7 @@ ReceiveFile(usd_handle_t ufd, struct rx_call *call, long blksize)
     return (error);
 }
 
-afs_int32
+static afs_int32
 DumpFunction(struct rx_call *call, void *rock)
 {
     char *filename = (char *)rock;
@@ -3286,10 +3272,6 @@ RestoreVolumeCmd(struct cmd_syndesc *as, void *arock)
     }
     MapPartIdIntoName(apart, apartName);
 
-    /*
-     * patch typo here - originally "parms[1]", should be "parms[0]"
-     */
-
     fprintf(STDOUT, "Restored volume %s on %s %s\n", avolname,
            as->parms[0].items->data, apartName);
     return 0;
@@ -3415,17 +3397,11 @@ RemoveSite(struct cmd_syndesc *as, void *arock)
                as->parms[1].items->data);
        exit(1);
     }
-/*
- *skip the partition validity check, since it is possible that the partition
- *has since been decomissioned.
- */
-/*
-       if (!IsPartValid(apart,aserver,&code)){
-           if(code) PrintError("",code);
-           else fprintf(STDERR,"vos : partition %s does not exist on the server\n",as->parms[1].items->data);
-           exit(1);
-       }
-*/
+    /*
+     * The partition validity check is skipped, since it is possible that the
+     * partition has already been decomissioned.
+     */
+
     code = UV_RemoveSite(aserver, apart, avolid);
     if (code) {
        PrintDiagnostics("remsite", code);
@@ -4218,7 +4194,7 @@ RenameVolume(struct cmd_syndesc *as, void *arock)
     return 0;
 }
 
-int
+static int
 GetVolumeInfo(afs_uint32 volid, afs_uint32 *server, afs_int32 *part, afs_int32 *voltype,
              struct nvldbentry *rentry)
 {
@@ -4465,41 +4441,6 @@ CompareVldbEntryByName(const void *p1, const void *p2)
     return (strcmp(arg1->name, arg2->name));
 }
 
-/*
-static int CompareVldbEntry(char *p1, char *p2)
-{
-    struct nvldbentry *arg1,*arg2;
-    int i;
-    int pos1, pos2;
-    char comp1[100],comp2[100];
-    char temp1[20],temp2[20];
-
-    arg1 = (struct nvldbentry *)p1;
-    arg2 = (struct nvldbentry *)p2;
-    pos1 = -1;
-    pos2 = -1;
-
-    for(i = 0; i < arg1->nServers; i++)
-       if(arg1->serverFlags[i] & VLSF_RWVOL) pos1 = i;
-    for(i = 0; i < arg2->nServers; i++)
-       if(arg2->serverFlags[i] & VLSF_RWVOL) pos2 = i;
-    if(pos1 == -1 || pos2 == -1){
-       pos1 = 0;
-       pos2 = 0;
-    }
-    sprintf(comp1,"%10u",arg1->serverNumber[pos1]);
-    sprintf(comp2,"%10u",arg2->serverNumber[pos2]);
-    sprintf(temp1,"%10u",arg1->serverPartition[pos1]);
-    sprintf(temp2,"%10u",arg2->serverPartition[pos2]);
-    strcat(comp1,temp1);
-    strcat(comp2,temp2);
-    strcat(comp1,arg1->name);
-    strcat(comp1,arg2->name);
-    return(strcmp(comp1,comp2));
-
-}
-
-*/
 static int
 ListVLDB(struct cmd_syndesc *as, void *arock)
 {
@@ -5855,7 +5796,7 @@ EndTrans(struct cmd_syndesc *as, void *arock)
     return 0;
 }
 
-int
+static int
 PrintDiagnostics(char *astring, afs_int32 acode)
 {
     switch (acode) {
@@ -5970,14 +5911,6 @@ MyBeforeProc(struct cmd_syndesc *as, void *arock)
     return 0;
 }
 
-int
-osi_audit(void)
-{
-/* this sucks but it works for now.
-*/
-    return 0;
-}
-
 #include "AFS_component_version_number.c"
 
 int