From a3be2c74a95489f63837840af8ec42049ce021bf Mon Sep 17 00:00:00 2001 From: Cheyenne Wills Date: Thu, 5 Nov 2020 13:49:54 -0700 Subject: [PATCH] vos: Remove dead code Clean out dead code from vos.c GetVolumeType - not referenced anywhere CompareVLDBEntry - commented out since 1st git commit osi_audit - Comment indicates this might have been needed at one point. Builds without it. Does not look like the vos executable is pulling in any of the audit code. RestoreVolume - remove stale comment about typo previous to openafs 1.0 RemoveSite - remove commented out partition check Change-Id: I9c0b59d5c37d403610c7a904717ac9765598fc99 Reviewed-on: https://gerrit.openafs.org/14008 Reviewed-by: Michael Meffie Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- src/volser/vos.c | 77 ++++---------------------------------------------------- 1 file changed, 5 insertions(+), 72 deletions(-) diff --git a/src/volser/vos.c b/src/volser/vos.c index 638c987..6fcdec8 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -283,20 +283,6 @@ 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 IsPartValid(afs_int32 partId, afs_uint32 server, afs_int32 *code) { @@ -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); @@ -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) { @@ -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 -- 1.9.4