Allow passing in human-readable units for specifying amounts of space
[openafs.git] / src / volser / vos.c
index 18d8a80..2078e19 100644 (file)
@@ -10,8 +10,6 @@
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID
-    ("$Header$");
 
 #include <sys/types.h>
 #include <string.h>
@@ -120,7 +118,7 @@ qPut(struct tqHead *ahead, afs_uint32 volid)
 }
 
 static void
-qGet(struct tqHead *ahead, afs_int32 *volid)
+qGet(struct tqHead *ahead, afs_uint32 *volid)
 {
     struct tqElem *tmp;
 
@@ -315,9 +313,9 @@ SendFile(usd_handle_t ufd, register 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
-WriteData(struct rx_call *call, char *rock)
+WriteData(struct rx_call *call, void *rock)
 {
-    char *filename;
+    char *filename = (char *) rock;
     usd_handle_t ufd;
     long blksize;
     afs_int32 error, code;
@@ -328,7 +326,6 @@ WriteData(struct rx_call *call, char *rock)
 
     error = 0;
 
-    filename = rock;
     if (!filename || !*filename) {
        usd_StandardInput(&ufd);
        blksize = 4096;
@@ -423,8 +420,9 @@ ReceiveFile(usd_handle_t ufd, struct rx_call *call, long blksize)
 }
 
 afs_int32
-DumpFunction(struct rx_call *call, char *filename)
+DumpFunction(struct rx_call *call, void *rock)
 {
+    char *filename = (char *)rock;
     usd_handle_t ufd;          /* default is to stdout */
     afs_int32 error = 0, code;
     afs_hyper_t size;
@@ -480,12 +478,9 @@ vos_ctime(afs_int32 *timep)
 }
 
 static void
-DisplayFormat(pntr, server, part, totalOK, totalNotOK, totalBusy, fast,
-             longlist, disp)
-     volintInfo *pntr;
-     afs_int32 server, part;
-     int *totalOK, *totalNotOK, *totalBusy;
-     int fast, longlist, disp;
+DisplayFormat(volintInfo *pntr, afs_int32 server, afs_int32 part,
+             int *totalOK, int *totalNotOK, int *totalBusy, int fast,
+             int longlist, int disp)
 {
     char pname[10];
 
@@ -536,13 +531,12 @@ DisplayFormat(pntr, server, part, totalOK, totalNotOK, totalBusy, fast,
 #endif
            if (!pntr->updateDate)
                fprintf(STDOUT, "    Last Update Never\n");
-           else {
+           else
                fprintf(STDOUT, "    Last Update %s",
                        vos_ctime( & pntr->updateDate));
-               fprintf(STDOUT,
-                       "    %d accesses in the past day (i.e., vnode references)\n",
-                       pntr->dayUse);
-           }
+           fprintf(STDOUT,
+                   "    %d accesses in the past day (i.e., vnode references)\n",
+                   pntr->dayUse);
        } else if (pntr->status == VBUSY) {
            *totalBusy += 1;
            qPut(&busyHead, pntr->volid);
@@ -622,18 +616,9 @@ DisplayFormat(pntr, server, part, totalOK, totalNotOK, totalBusy, fast,
  *------------------------------------------------------------------------*/
 
 static void
-XDisplayFormat(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP,
-              a_totalBusyP, a_fast, a_int32, a_showProblems)
-     volintXInfo *a_xInfoP;
-     afs_int32 a_servID;
-     afs_int32 a_partID;
-     int *a_totalOKP;
-     int *a_totalNotOKP;
-     int *a_totalBusyP;
-     int a_fast;
-     int a_int32;
-     int a_showProblems;
-
+XDisplayFormat(volintXInfo *a_xInfoP, afs_int32 a_servID, afs_int32 a_partID,
+              int *a_totalOKP, int *a_totalNotOKP, int *a_totalBusyP,
+              int a_fast, int a_int32, int a_showProblems)
 {                              /*XDisplayFormat */
 
     char pname[10];
@@ -693,13 +678,12 @@ XDisplayFormat(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP,
 #endif
            if (!a_xInfoP->updateDate)
                fprintf(STDOUT, "    Last Update Never\n");
-           else {
+           else
                fprintf(STDOUT, "    Last Update %s",
                        vos_ctime( & a_xInfoP->updateDate));
-               fprintf(STDOUT,
-                       "    %d accesses in the past day (i.e., vnode references)\n",
-                       a_xInfoP->dayUse);
-           }
+           fprintf(STDOUT,
+                   "    %d accesses in the past day (i.e., vnode references)\n",
+                   a_xInfoP->dayUse);
 
            /*
             * Print all the read/write and authorship stats.
@@ -858,18 +842,9 @@ XDisplayFormat(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP,
  *------------------------------------------------------------------------*/
 
 static void
-XDisplayFormat2(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP,
-              a_totalBusyP, a_fast, a_int32, a_showProblems)
-     volintXInfo *a_xInfoP;
-     afs_int32 a_servID;
-     afs_int32 a_partID;
-     int *a_totalOKP;
-     int *a_totalNotOKP;
-     int *a_totalBusyP;
-     int a_fast;
-     int a_int32;
-     int a_showProblems;
-
+XDisplayFormat2(volintXInfo *a_xInfoP, afs_int32 a_servID, afs_int32 a_partID,
+               int *a_totalOKP, int *a_totalNotOKP, int *a_totalBusyP,
+               int a_fast, int a_int32, int a_showProblems)
 {                              /*XDisplayFormat */
     if (a_fast) {
        /*
@@ -904,7 +879,7 @@ XDisplayFormat2(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP,
                }
 
                fprintf(STDOUT, "name\t\t%s\n", a_xInfoP->name);
-               fprintf(STDOUT, "id\t\t%lu\n", afs_cast_uint32(a_xInfoP->volid));
+               fprintf(STDOUT, "id\t\t%lu\n", afs_printable_uint32_lu(a_xInfoP->volid));
                fprintf(STDOUT, "serv\t\t%s\t%s\n", address, hostname);
                fprintf(STDOUT, "part\t\t%s\n", pname);
                switch (a_xInfoP->status) {
@@ -919,11 +894,11 @@ XDisplayFormat2(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP,
                        return;
                }
                fprintf(STDOUT, "backupID\t%lu\n", 
-                       afs_cast_uint32(a_xInfoP->backupID));
+                       afs_printable_uint32_lu(a_xInfoP->backupID));
                fprintf(STDOUT, "parentID\t%lu\n", 
-                       afs_cast_uint32(a_xInfoP->parentID));
+                       afs_printable_uint32_lu(a_xInfoP->parentID));
                fprintf(STDOUT, "cloneID\t\t%lu\n", 
-                       afs_cast_uint32(a_xInfoP->cloneID));
+                       afs_printable_uint32_lu(a_xInfoP->cloneID));
                fprintf(STDOUT, "inUse\t\t%s\n", a_xInfoP->inUse ? "Y" : "N");
                switch (a_xInfoP->type) {
                case 0:
@@ -940,19 +915,19 @@ XDisplayFormat2(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP,
                        break;
                }
                fprintf(STDOUT, "creationDate\t%-9lu\t%s", 
-                       afs_cast_uint32(a_xInfoP->creationDate),
+                       afs_printable_uint32_lu(a_xInfoP->creationDate),
                        vos_ctime(&a_xInfoP->creationDate));
                fprintf(STDOUT, "accessDate\t%-9lu\t%s", 
-                       afs_cast_uint32(a_xInfoP->accessDate),
+                       afs_printable_uint32_lu(a_xInfoP->accessDate),
                        vos_ctime(&a_xInfoP->accessDate));
                fprintf(STDOUT, "updateDate\t%-9lu\t%s", 
-                       afs_cast_uint32(a_xInfoP->updateDate),
+                       afs_printable_uint32_lu(a_xInfoP->updateDate),
                        vos_ctime(&a_xInfoP->updateDate));
                fprintf(STDOUT, "backupDate\t%-9lu\t%s", 
-                       afs_cast_uint32(a_xInfoP->backupDate),
+                       afs_printable_uint32_lu(a_xInfoP->backupDate),
                        vos_ctime(&a_xInfoP->backupDate));
                fprintf(STDOUT, "copyDate\t%-9lu\t%s", 
-                       afs_cast_uint32(a_xInfoP->copyDate),
+                       afs_printable_uint32_lu(a_xInfoP->copyDate),
                        vos_ctime(&a_xInfoP->copyDate));
                
                fprintf(STDOUT, "diskused\t%u\n", a_xInfoP->size);
@@ -1039,9 +1014,7 @@ XDisplayFormat2(a_xInfoP, a_servID, a_partID, a_totalOKP, a_totalNotOKP,
 
 #ifdef FULL_LISTVOL_SWITCH
 static void
-DisplayFormat2(server, partition, pntr)
-     long server, partition;
-     volintInfo *pntr;
+DisplayFormat2(long server, long partition, volintInfo *pntr)
 {
     static long server_cache = -1, partition_cache = -1;
     static char hostname[256], address[32], pname[16];
@@ -1060,7 +1033,7 @@ DisplayFormat2(server, partition, pntr)
     }
     fprintf(STDOUT, "name\t\t%s\n", pntr->name);
     fprintf(STDOUT, "id\t\t%lu\n", 
-           afs_cast_uint32(pntr->volid));
+           afs_printable_uint32_lu(pntr->volid));
     fprintf(STDOUT, "serv\t\t%s\t%s\n", address, hostname);
     fprintf(STDOUT, "part\t\t%s\n", pname);
     switch (pntr->status) {
@@ -1075,11 +1048,11 @@ DisplayFormat2(server, partition, pntr)
        return;
     }
     fprintf(STDOUT, "backupID\t%lu\n", 
-           afs_cast_uint32(pntr->backupID));
+           afs_printable_uint32_lu(pntr->backupID));
     fprintf(STDOUT, "parentID\t%lu\n", 
-           afs_cast_uint32(pntr->parentID));
+           afs_printable_uint32_lu(pntr->parentID));
     fprintf(STDOUT, "cloneID\t\t%lu\n", 
-           afs_cast_uint32(pntr->cloneID));
+           afs_printable_uint32_lu(pntr->cloneID));
     fprintf(STDOUT, "inUse\t\t%s\n", pntr->inUse ? "Y" : "N");
     fprintf(STDOUT, "needsSalvaged\t%s\n", pntr->needsSalvaged ? "Y" : "N");
     /* 0xD3 is from afs/volume.h since I had trouble including the file */
@@ -1099,41 +1072,39 @@ DisplayFormat2(server, partition, pntr)
        break;
     }
     fprintf(STDOUT, "creationDate\t%-9lu\t%s", 
-           afs_cast_uint32(pntr->creationDate),
+           afs_printable_uint32_lu(pntr->creationDate),
            vos_ctime(&pntr->creationDate));
     fprintf(STDOUT, "accessDate\t%-9lu\t%s", 
-           afs_cast_uint32(pntr->accessDate),
+           afs_printable_uint32_lu(pntr->accessDate),
            vos_ctime(&pntr->accessDate));
     fprintf(STDOUT, "updateDate\t%-9lu\t%s", 
-           afs_cast_uint32(pntr->updateDate),
+           afs_printable_uint32_lu(pntr->updateDate),
            vos_ctime(&pntr->updateDate));
     fprintf(STDOUT, "backupDate\t%-9lu\t%s", 
-           afs_cast_uint32(pntr->backupDate),
+           afs_printable_uint32_lu(pntr->backupDate),
            vos_ctime(&pntr->backupDate));
     fprintf(STDOUT, "copyDate\t%-9lu\t%s", 
-           afs_cast_uint32(pntr->copyDate),
+           afs_printable_uint32_lu(pntr->copyDate),
            vos_ctime(&pntr->copyDate));
     fprintf(STDOUT, "flags\t\t%#lx\t(Optional)\n", 
-           afs_cast_uint32(pntr->flags));
+           afs_printable_uint32_lu(pntr->flags));
     fprintf(STDOUT, "diskused\t%u\n", pntr->size);
     fprintf(STDOUT, "maxquota\t%u\n", pntr->maxquota);
     fprintf(STDOUT, "minquota\t%lu\t(Optional)\n", 
-           afs_cast_uint32(pntr->spare0));
+           afs_printable_uint32_lu(pntr->spare0));
     fprintf(STDOUT, "filecount\t%u\n", pntr->filecount);
     fprintf(STDOUT, "dayUse\t\t%u\n", pntr->dayUse);
     fprintf(STDOUT, "weekUse\t\t%lu\t(Optional)\n",
-           afs_cast_uint32(pntr->spare1));
+           afs_printable_uint32_lu(pntr->spare1));
     fprintf(STDOUT, "spare2\t\t%lu\t(Optional)\n", 
-           afs_cast_uint32(pntr->spare2));
+           afs_printable_uint32_lu(pntr->spare2));
     fprintf(STDOUT, "spare3\t\t%lu\t(Optional)\n", 
-           afs_cast_uint32(pntr->spare3));
+           afs_printable_uint32_lu(pntr->spare3));
     return;
 }
 
 static void
-DisplayVolumes2(server, partition, pntr, count)
-     volintInfo *pntr;
-     long server, partition, count;
+DisplayVolumes2(long server, long partition, volintInfo *pntr, long count)
 {
     long i;
 
@@ -1148,11 +1119,9 @@ DisplayVolumes2(server, partition, pntr, count)
 #endif /* FULL_LISTVOL_SWITCH */
 
 static void
-DisplayVolumes(server, part, pntr, count, longlist, fast, quiet)
-     afs_int32 server, part;
-     volintInfo *pntr;
-     afs_int32 count, longlist, fast;
-     int quiet;
+DisplayVolumes(afs_int32 server, afs_int32 part, volintInfo *pntr,
+              afs_int32 count, afs_int32 longlist, afs_int32 fast,
+              int quiet)
 {
     int totalOK, totalNotOK, totalBusy, i;
     afs_uint32 volid = 0;
@@ -1216,16 +1185,9 @@ DisplayVolumes(server, part, pntr, count, longlist, fast, quiet)
  *------------------------------------------------------------------------*/
 
 static void
-XDisplayVolumes(a_servID, a_partID, a_xInfoP, a_count, a_int32, a_fast,
-               a_quiet)
-     afs_int32 a_servID;
-     afs_int32 a_partID;
-     volintXInfo *a_xInfoP;
-     afs_int32 a_count;
-     afs_int32 a_int32;
-     afs_int32 a_fast;
-     int a_quiet;
-
+XDisplayVolumes(afs_int32 a_servID, afs_int32 a_partID, volintXInfo *a_xInfoP,
+               afs_int32 a_count, afs_int32 a_int32, afs_int32 a_fast,
+               int a_quiet)
 {                              /*XDisplayVolumes */
 
     int totalOK;               /*Total OK volumes */
@@ -1307,16 +1269,9 @@ XDisplayVolumes(a_servID, a_partID, a_xInfoP, a_count, a_int32, a_fast,
  *------------------------------------------------------------------------*/
 
 static void
-XDisplayVolumes2(a_servID, a_partID, a_xInfoP, a_count, a_int32, a_fast,
-               a_quiet)
-     afs_int32 a_servID;
-     afs_int32 a_partID;
-     volintXInfo *a_xInfoP;
-     afs_int32 a_count;
-     afs_int32 a_int32;
-     afs_int32 a_fast;
-     int a_quiet;
-
+XDisplayVolumes2(afs_int32 a_servID, afs_int32 a_partID, volintXInfo *a_xInfoP,
+                afs_int32 a_count, afs_int32 a_int32, afs_int32 a_fast,
+                int a_quiet)
 {                              /*XDisplayVolumes */
 
     int totalOK;               /*Total OK volumes */
@@ -1379,11 +1334,8 @@ XDisplayVolumes2(a_servID, a_partID, a_xInfoP, a_count, a_int32, a_fast,
 /* set <server> and <part> to the correct values depending on 
  * <voltype> and <entry> */
 static void
-GetServerAndPart(entry, voltype, server, part, previdx)
-     struct nvldbentry *entry;
-     afs_int32 *server, *part;
-     int voltype;
-     int *previdx;
+GetServerAndPart(struct nvldbentry *entry, int voltype, afs_int32 *server,
+                afs_int32 *part, int *previdx)
 {
     int i, istart, vtype;
 
@@ -1448,13 +1400,8 @@ PostVolumeStats(struct nvldbentry *entry)
  *------------------------------------------------------------------------*/
 
 static void
-XVolumeStats(a_xInfoP, a_entryP, a_srvID, a_partID, a_volType)
-     volintXInfo *a_xInfoP;
-     struct nvldbentry *a_entryP;
-     afs_int32 a_srvID;
-     afs_int32 a_partID;
-     int a_volType;
-
+XVolumeStats(volintXInfo *a_xInfoP, struct nvldbentry *a_entryP,
+            afs_int32 a_srvID, afs_int32 a_partID, int a_volType)
 {                              /*XVolumeStats */
 
     int totalOK, totalNotOK, totalBusy;        /*Dummies - we don't really count here */
@@ -1706,7 +1653,6 @@ static int
 SetFields(register struct cmd_syndesc *as, void *arock)
 {
     struct nvldbentry entry;
-    afs_int32 vcode = 0;
     volintInfo info;
     afs_uint32 volid;
     afs_int32 code, err;
@@ -1745,7 +1691,7 @@ SetFields(register struct cmd_syndesc *as, void *arock)
 
     if (as->parms[1].items) {
        /* -max <quota> */
-       code = util_GetInt32(as->parms[1].items->data, &info.maxquota);
+       code = util_GetHumanInt32(as->parms[1].items->data, &info.maxquota);
        if (code) {
            fprintf(STDERR, "invalid quota value\n");
            return code;
@@ -1956,13 +1902,7 @@ CreateVolume(register struct cmd_syndesc *as, void *arock)
     }
 
     if (as->parms[3].items) {
-       if (!IsNumeric(as->parms[3].items->data)) {
-           fprintf(STDERR, "Initial quota %s should be numeric.\n",
-                   as->parms[3].items->data);
-           return EINVAL;
-       }
-
-       code = util_GetInt32(as->parms[3].items->data, &quota);
+       code = util_GetHumanInt32(as->parms[3].items->data, &quota);
        if (code) {
            fprintf(STDERR, "vos: bad integer specified for quota.\n");
            return code;
@@ -1983,9 +1923,9 @@ CreateVolume(register struct cmd_syndesc *as, void *arock)
     return 0;
 }
 
+#if 0
 static afs_int32
-DeleteAll(entry)
-     struct nvldbentry *entry;
+DeleteAll(struct nvldbentry *entry)
 {
     int i;
     afs_int32 error, code, curserver, curpart;
@@ -2007,6 +1947,7 @@ DeleteAll(entry)
     }
     return error;
 }
+#endif
 
 static int
 DeleteVolume(struct cmd_syndesc *as, void *arock)
@@ -2129,7 +2070,7 @@ DeleteVolume(struct cmd_syndesc *as, void *arock)
 }
 
 #define TESTM  0               /* set for move space tests, clear for production */
-static
+static int
 MoveVolume(register struct cmd_syndesc *as, void *arock)
 {
 
@@ -2830,8 +2771,8 @@ ReleaseVolume(register struct cmd_syndesc *as, void *arock)
     return 0;
 }
 
-static
-DumpVolume(register struct cmd_syndesc *as, void *arock)
+static int
+DumpVolumeCmd(register struct cmd_syndesc *as, void *arock)
 {
     afs_uint32 avolid;
     afs_int32 aserver, apart, voltype, fromdate = 0, code, err, i, flags;
@@ -2932,7 +2873,7 @@ retry_dump:
 #define TS_NEW 3
 
 static int
-RestoreVolume(register struct cmd_syndesc *as, void *arock)
+RestoreVolumeCmd(register struct cmd_syndesc *as, void *arock)
 {
     afs_uint32 avolid, aparentid;
     afs_int32 aserver, apart, code, vcode, err;
@@ -3446,8 +3387,7 @@ ListPartitions(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-CompareVolName(p1, p2)
-     char *p1, *p2;
+CompareVolName(const void *p1, const void *p2)
 {
     volintInfo *arg1, *arg2;
 
@@ -3480,9 +3420,7 @@ CompareVolName(p1, p2)
  *------------------------------------------------------------------------*/
 
 static int
-XCompareVolName(a_obj1P, a_obj2P)
-     char *a_obj1P, *a_obj2P;
-
+XCompareVolName(const void *a_obj1P, const void *a_obj2P)
 {                              /*XCompareVolName */
 
     return (strcmp
@@ -3492,8 +3430,7 @@ XCompareVolName(a_obj1P, a_obj2P)
 }                              /*XCompareVolName */
 
 static int
-CompareVolID(p1, p2)
-     char *p1, *p2;
+CompareVolID(const void *p1, const void *p2)
 {
     volintInfo *arg1, *arg2;
 
@@ -3531,9 +3468,7 @@ CompareVolID(p1, p2)
  *------------------------------------------------------------------------*/
 
 static int
-XCompareVolID(a_obj1P, a_obj2P)
-     char *a_obj1P, *a_obj2P;
-
+XCompareVolID(const void *a_obj1P, const void *a_obj2P)
 {                              /*XCompareVolID */
 
     afs_int32 id1, id2;                /*Volume IDs we're comparing */
@@ -3569,7 +3504,7 @@ XCompareVolID(a_obj1P, a_obj2P)
  *     As advertised.
  *------------------------------------------------------------------------*/
 
-static
+static int
 ListVolumes(register struct cmd_syndesc *as, void *arock)
 {
     afs_int32 apart, int32list, fast;
@@ -3863,9 +3798,8 @@ SyncServer(register struct cmd_syndesc *as, void *arock)
 
 }
 
-static
-VolumeInfoCmd(name)
-     char *name;
+static int
+VolumeInfoCmd(char *name)
 {
     struct nvldbentry entry;
     afs_int32 vcode;
@@ -4365,8 +4299,7 @@ DeleteEntry(register struct cmd_syndesc *as, void *arock)
 
 
 static int
-CompareVldbEntryByName(p1, p2)
-     char *p1, *p2;
+CompareVldbEntryByName(const void *p1, const void *p2)
 {
     struct nvldbentry *arg1, *arg2;
 
@@ -4376,8 +4309,7 @@ CompareVldbEntryByName(p1, p2)
 }
 
 /*
-static int CompareVldbEntry(p1,p2)
-char *p1,*p2;
+static int CompareVldbEntry(char *p1, char *p2)
 {
     struct nvldbentry *arg1,*arg2;
     int i;
@@ -4599,11 +4531,14 @@ BackSys(register struct cmd_syndesc *as, void *arock)
     int seenprefix, seenxprefix, exclude, ex, exp, noaction;
     afs_int32 totalBack = 0;
     afs_int32 totalFail = 0;
-    int previdx = -1, error, same;
-    int comp = 0;
+    int previdx = -1;
+    int error;
+    int same = 0;
     struct cmd_item *ti;
-    char *ccode;
     int match = 0;
+#ifndef HAVE_POSIX_REGEX
+    char *ccode;
+#endif
 
     memset(&attributes, 0, sizeof(struct VldbListByAttributes));
     attributes.Mask = 0;
@@ -4917,7 +4852,7 @@ static int
 UnlockVLDB(register struct cmd_syndesc *as, void *arock)
 {
     afs_int32 apart;
-    afs_int32 aserver = NULL;
+    afs_int32 aserver = 0;
     afs_int32 code;
     afs_int32 vcode;
     struct VldbListByAttributes attributes;
@@ -5708,7 +5643,7 @@ MyBeforeProc(struct cmd_syndesc *as, void *arock)
 }
 
 int
-osi_audit()
+osi_audit(void)
 {
 /* this sucks but it works for now.
 */
@@ -5717,9 +5652,8 @@ osi_audit()
 
 #include "AFS_component_version_number.c"
 
-main(argc, argv)
-     int argc;
-     char **argv;
+int
+main(int argc, char **argv)
 {
     register afs_int32 code;
 
@@ -5843,7 +5777,7 @@ main(argc, argv)
                "force a complete release");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("dump", DumpVolume, NULL, "dump a volume");
+    ts = cmd_CreateSyntax("dump", DumpVolumeCmd, NULL, "dump a volume");
     cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
     cmd_AddParm(ts, "-time", CMD_SINGLE, CMD_OPTIONAL, "dump from time");
     cmd_AddParm(ts, "-file", CMD_SINGLE, CMD_OPTIONAL, "dump file");
@@ -5855,7 +5789,8 @@ main(argc, argv)
                "omit unchanged directories from an incremental dump");
     COMMONPARMS;
 
-    ts = cmd_CreateSyntax("restore", RestoreVolume, NULL, "restore a volume");
+    ts = cmd_CreateSyntax("restore", RestoreVolumeCmd, NULL,
+                         "restore a volume");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
     cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
     cmd_AddParm(ts, "-name", CMD_SINGLE, 0, "name of volume to be restored");