#include <afsconfig.h>
#include <afs/param.h>
-RCSID
- ("$Header$");
#include <sys/types.h>
#include <string.h>
/* Local Prototypes */
int PrintDiagnostics(char *astring, afs_int32 acode);
-int GetVolumeInfo(afs_int32 volid, afs_int32 *server, afs_int32 *part,
+int GetVolumeInfo(afs_uint32 volid, afs_int32 *server, afs_int32 *part,
afs_int32 *voltype, struct nvldbentry *rentry);
struct tqElem {
- afs_int32 volid;
+ afs_uint32 volid;
struct tqElem *next;
};
static void
-qPut(struct tqHead *ahead, afs_int32 volid)
+qPut(struct tqHead *ahead, afs_uint32 volid)
{
struct tqElem *elem;
}
static void
-qGet(struct tqHead *ahead, afs_int32 *volid)
+qGet(struct tqHead *ahead, afs_uint32 *volid)
{
struct tqElem *tmp;
/* 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;
error = 0;
- filename = rock;
if (!filename || !*filename) {
usd_StandardInput(&ufd);
blksize = 4096;
}
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;
}
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];
#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);
*------------------------------------------------------------------------*/
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];
#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.
*------------------------------------------------------------------------*/
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) {
/*
}
fprintf(STDOUT, "name\t\t%s\n", a_xInfoP->name);
- fprintf(STDOUT, "id\t\t%lu\n", 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) {
- case VOK:
- fprintf(STDOUT, "status\t\tOK\n");
- break;
- case VBUSY:
- fprintf(STDOUT, "status\t\tBUSY\n");
- return;
- default:
- fprintf(STDOUT, "status\t\tUNATTACHABLE\n");
- return;
- }
- fprintf(STDOUT, "backupID\t%lu\n", a_xInfoP->backupID);
- fprintf(STDOUT, "parentID\t%lu\n", a_xInfoP->parentID);
- fprintf(STDOUT, "cloneID\t\t%lu\n", a_xInfoP->cloneID);
+ fprintf(STDOUT, "status\t\tOK\n");
+ fprintf(STDOUT, "backupID\t%lu\n",
+ afs_printable_uint32_lu(a_xInfoP->backupID));
+ fprintf(STDOUT, "parentID\t%lu\n",
+ afs_printable_uint32_lu(a_xInfoP->parentID));
+ fprintf(STDOUT, "cloneID\t\t%lu\n",
+ 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:
fprintf(STDOUT, "type\t\t?\n");
break;
}
- fprintf(STDOUT, "creationDate\t%-9lu\t%s", a_xInfoP->creationDate,
+ fprintf(STDOUT, "creationDate\t%-9lu\t%s",
+ afs_printable_uint32_lu(a_xInfoP->creationDate),
vos_ctime(&a_xInfoP->creationDate));
- fprintf(STDOUT, "accessDate\t%-9lu\t%s", a_xInfoP->accessDate,
+ fprintf(STDOUT, "accessDate\t%-9lu\t%s",
+ afs_printable_uint32_lu(a_xInfoP->accessDate),
vos_ctime(&a_xInfoP->accessDate));
- fprintf(STDOUT, "updateDate\t%-9lu\t%s", a_xInfoP->updateDate,
+ fprintf(STDOUT, "updateDate\t%-9lu\t%s",
+ afs_printable_uint32_lu(a_xInfoP->updateDate),
vos_ctime(&a_xInfoP->updateDate));
- fprintf(STDOUT, "backupDate\t%-9lu\t%s", a_xInfoP->backupDate,
+ fprintf(STDOUT, "backupDate\t%-9lu\t%s",
+ afs_printable_uint32_lu(a_xInfoP->backupDate),
vos_ctime(&a_xInfoP->backupDate));
- fprintf(STDOUT, "copyDate\t%-9lu\t%s", a_xInfoP->copyDate,
+ fprintf(STDOUT, "copyDate\t%-9lu\t%s",
+ afs_printable_uint32_lu(a_xInfoP->copyDate),
vos_ctime(&a_xInfoP->copyDate));
fprintf(STDOUT, "diskused\t%u\n", a_xInfoP->size);
#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];
MapPartIdIntoName(partition, pname);
partition_cache = partition;
}
- fprintf(STDOUT, "name\t\t%s\n", pntr->name);
- fprintf(STDOUT, "id\t\t%lu\n", pntr->volid);
+
+ if (pntr->status == VOK)
+ fprintf(STDOUT, "name\t\t%s\n", pntr->name);
+
+ fprintf(STDOUT, "id\t\t%lu\n",
+ 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) {
fprintf(STDOUT, "status\t\tUNATTACHABLE\n");
return;
}
- fprintf(STDOUT, "backupID\t%lu\n", pntr->backupID);
- fprintf(STDOUT, "parentID\t%lu\n", pntr->parentID);
- fprintf(STDOUT, "cloneID\t\t%lu\n", pntr->cloneID);
+ fprintf(STDOUT, "backupID\t%lu\n",
+ afs_printable_uint32_lu(pntr->backupID));
+ fprintf(STDOUT, "parentID\t%lu\n",
+ afs_printable_uint32_lu(pntr->parentID));
+ fprintf(STDOUT, "cloneID\t\t%lu\n",
+ 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 */
fprintf(STDOUT, "type\t\t?\n");
break;
}
- fprintf(STDOUT, "creationDate\t%-9lu\t%s", pntr->creationDate,
+ fprintf(STDOUT, "creationDate\t%-9lu\t%s",
+ afs_printable_uint32_lu(pntr->creationDate),
vos_ctime(&pntr->creationDate));
- fprintf(STDOUT, "accessDate\t%-9lu\t%s", pntr->accessDate,
+ fprintf(STDOUT, "accessDate\t%-9lu\t%s",
+ afs_printable_uint32_lu(pntr->accessDate),
vos_ctime(&pntr->accessDate));
- fprintf(STDOUT, "updateDate\t%-9lu\t%s", pntr->updateDate,
+ fprintf(STDOUT, "updateDate\t%-9lu\t%s",
+ afs_printable_uint32_lu(pntr->updateDate),
vos_ctime(&pntr->updateDate));
- fprintf(STDOUT, "backupDate\t%-9lu\t%s", pntr->backupDate,
+ fprintf(STDOUT, "backupDate\t%-9lu\t%s",
+ afs_printable_uint32_lu(pntr->backupDate),
vos_ctime(&pntr->backupDate));
- fprintf(STDOUT, "copyDate\t%-9lu\t%s", pntr->copyDate,
+ fprintf(STDOUT, "copyDate\t%-9lu\t%s",
+ afs_printable_uint32_lu(pntr->copyDate),
vos_ctime(&pntr->copyDate));
- fprintf(STDOUT, "flags\t\t%#lx\t(Optional)\n", pntr->flags);
+ fprintf(STDOUT, "flags\t\t%#lx\t(Optional)\n",
+ 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", pntr->spare0);
+ fprintf(STDOUT, "minquota\t%lu\t(Optional)\n",
+ 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", pntr->spare1);
- fprintf(STDOUT, "spare2\t\t%lu\t(Optional)\n", pntr->spare2);
- fprintf(STDOUT, "spare3\t\t%lu\t(Optional)\n", pntr->spare3);
+ fprintf(STDOUT, "weekUse\t\t%lu\t(Optional)\n",
+ afs_printable_uint32_lu(pntr->spare1));
+ fprintf(STDOUT, "spare2\t\t%lu\t(Optional)\n",
+ afs_printable_uint32_lu(pntr->spare2));
+ fprintf(STDOUT, "spare3\t\t%lu\t(Optional)\n",
+ 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;
#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_int32 volid = 0;
+ afs_uint32 volid = 0;
totalOK = 0;
totalNotOK = 0;
*------------------------------------------------------------------------*/
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 */
int totalNotOK; /*Total screwed volumes */
int totalBusy; /*Total busy volumes */
int i; /*Loop variable */
- afs_int32 volid = 0; /*Current volume ID */
+ afs_uint32 volid = 0; /*Current volume ID */
/*
* Initialize counters and (global!!) queues.
*------------------------------------------------------------------------*/
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 */
int totalNotOK; /*Total screwed volumes */
int totalBusy; /*Total busy volumes */
int i; /*Loop variable */
- afs_int32 volid = 0; /*Current volume ID */
+ afs_uint32 volid = 0; /*Current volume ID */
/*
* Initialize counters and (global!!) queues.
/* 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;
*------------------------------------------------------------------------*/
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 */
NukeVolume(register struct cmd_syndesc *as)
{
register afs_int32 code;
- afs_int32 volID, err;
+ afs_uint32 volID;
+ afs_int32 err;
afs_int32 partID;
afs_int32 server;
register char *tp;
afs_int32 vcode = 0;
volintInfo *pntr = (volintInfo *) 0;
volintXInfo *xInfoP = (volintXInfo *) 0;
- afs_int32 volid;
+ afs_uint32 volid;
afs_int32 code, err, error = 0;
int voltype, foundserv = 0, foundentry = 0;
afs_int32 aserver, apart;
SetFields(register struct cmd_syndesc *as, void *arock)
{
struct nvldbentry entry;
- afs_int32 vcode = 0;
volintInfo info;
- afs_int32 volid;
+ afs_uint32 volid;
afs_int32 code, err;
afs_int32 aserver, apart;
int previdx = -1;
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;
static int
volOnline(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 server, partition, volid;
+ afs_int32 server, partition;
+ afs_uint32 volid;
afs_int32 code, err = 0;
server = GetServer(as->parms[0].items->data);
static int
volOffline(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 server, partition, volid;
+ afs_int32 server, partition;
+ afs_uint32 volid;
afs_int32 code, err = 0;
afs_int32 transflag, sleeptime, transdone;
{
afs_int32 pnum;
char part[10];
- afs_int32 volid, code;
+ afs_uint32 volid;
+ afs_int32 code;
struct nvldbentry entry;
afs_int32 vcode;
afs_int32 quota;
}
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, "a);
+ code = util_GetHumanInt32(as->parms[3].items->data, "a);
if (code) {
fprintf(STDERR, "vos: bad integer specified for quota.\n");
return code;
return 0;
}
+#if 0
static afs_int32
-DeleteAll(entry)
- struct nvldbentry *entry;
+DeleteAll(struct nvldbentry *entry)
{
int i;
- afs_int32 error, code, curserver, curpart, volid;
+ afs_int32 error, code, curserver, curpart;
+ afs_uint32 volid;
MapHostToNetwork(entry);
error = 0;
}
return error;
}
+#endif
static int
DeleteVolume(struct cmd_syndesc *as, void *arock)
{
afs_int32 err, code = 0;
- afs_int32 server = 0, partition = -1, volid;
+ afs_int32 server = 0, partition = -1;
+ afs_uint32 volid;
char pname[10];
afs_int32 idx, j;
}
#define TESTM 0 /* set for move space tests, clear for production */
-static
+static int
MoveVolume(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 volid, fromserver, toserver, frompart, topart;
+ afs_uint32 volid;
+ afs_int32 fromserver, toserver, frompart, topart;
afs_int32 flags, code, err;
char fromPartName[10], toPartName[10];
exit(1);
}
if (TESTM)
- fprintf(STDOUT, "target partition %s free space %d\n", toPartName,
+ fprintf(STDOUT, "target partition %s free space %" AFS_INT64_FMT "\n", toPartName,
partition.free);
p = (volintInfo *) 0;
static int
CopyVolume(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 volid, fromserver, toserver, frompart, topart, code, err, flags;
+ afs_uint32 volid;
+ afs_int32 fromserver, toserver, frompart, topart, code, err, flags;
char fromPartName[10], toPartName[10], *tovolume;
struct nvldbentry entry;
struct diskPartition64 partition; /* for space check */
exit(1);
}
if (TESTM)
- fprintf(STDOUT, "target partition %s free space %d\n", toPartName,
+ fprintf(STDOUT, "target partition %s free space %" AFS_INT64_FMT "\n", toPartName,
partition.free);
p = (volintInfo *) 0;
static int
ShadowVolume(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 volid, fromserver, toserver, frompart, topart, tovolid;
+ afs_uint32 volid, tovolid;
+ afs_int32 fromserver, toserver, frompart, topart;
afs_int32 code, err, flags;
char fromPartName[10], toPartName[10], toVolName[32], *tovolume;
struct diskPartition64 partition; /* for space check */
exit(1);
}
if (TESTM)
- fprintf(STDOUT, "target partition %s free space %d\n", toPartName,
+ fprintf(STDOUT, "target partition %s free space %" AFS_INT64_FMT "\n", toPartName,
partition.free);
/* Don't do this again if we did it above */
static int
CloneVolume(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 server, part, volid, cloneid, voltype;
+ afs_uint32 volid, cloneid;
+ afs_int32 server, part, voltype;
char partName[10], *volname;
afs_int32 code, err, flags;
struct nvldbentry entry;
static int
BackupVolume(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, aserver, apart, vtype, code, err;
+ afs_uint32 avolid;
+ afs_int32 aserver, apart, vtype, code, err;
struct nvldbentry entry;
- afs_int32 buvolid, buserver, bupart, butype;
+ afs_uint32 buvolid;
+ afs_int32 buserver, bupart, butype;
struct nvldbentry buentry;
avolid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);
{
struct nvldbentry entry;
- afs_int32 avolid, aserver, apart, vtype, code, err;
+ afs_uint32 avolid;
+ afs_int32 aserver, apart, vtype, code, err;
int force = 0;
if (as->parms[1].items)
return 0;
}
-static
-DumpVolume(register struct cmd_syndesc *as, void *arock)
+static int
+DumpVolumeCmd(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, aserver, apart, voltype, fromdate = 0, code, err, i, flags;
+ afs_uint32 avolid;
+ afs_int32 aserver, apart, voltype, fromdate = 0, code, err, i, flags;
char filename[MAXPATHLEN];
struct nvldbentry entry;
#define TS_NEW 3
static int
-RestoreVolume(register struct cmd_syndesc *as, void *arock)
+RestoreVolumeCmd(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, aparentid, aserver, apart, code, vcode, err;
+ afs_uint32 avolid, aparentid;
+ afs_int32 aserver, apart, code, vcode, err;
afs_int32 aoverwrite = ASK;
afs_int32 acreation = 0, alastupdate = 0;
int restoreflags = 0;
static int
LockReleaseCmd(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, code, err;
+ afs_uint32 avolid;
+ afs_int32 code, err;
avolid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);
if (avolid == 0) {
static int
AddSite(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, aserver, apart, code, err, valid = 0;
+ afs_uint32 avolid;
+ afs_int32 aserver, apart, code, err, valid = 0;
char apartName[10], avolname[VOLSER_MAXVOLNAME + 1];
vsu_ExtractName(avolname, as->parms[2].items->data);;
RemoveSite(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, aserver, apart, code, err;
+ afs_uint32 avolid;
+ afs_int32 aserver, apart, code, err;
char apartName[10], avolname[VOLSER_MAXVOLNAME + 1];
vsu_ExtractName(avolname, as->parms[2].items->data);
static int
ChangeLocation(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, aserver, apart, code, err;
+ afs_uint32 avolid;
+ afs_int32 aserver, apart, code, err;
char apartName[10];
avolid = vsu_GetVolumeID(as->parms[2].items->data, cstruct, &err);
}
static int
-CompareVolName(p1, p2)
- char *p1, *p2;
+CompareVolName(const void *p1, const void *p2)
{
volintInfo *arg1, *arg2;
*------------------------------------------------------------------------*/
static int
-XCompareVolName(a_obj1P, a_obj2P)
- char *a_obj1P, *a_obj2P;
-
+XCompareVolName(const void *a_obj1P, const void *a_obj2P)
{ /*XCompareVolName */
return (strcmp
} /*XCompareVolName */
static int
-CompareVolID(p1, p2)
- char *p1, *p2;
+CompareVolID(const void *p1, const void *p2)
{
volintInfo *arg1, *arg2;
*------------------------------------------------------------------------*/
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 */
* As advertised.
*------------------------------------------------------------------------*/
-static
+static int
ListVolumes(register struct cmd_syndesc *as, void *arock)
{
afs_int32 apart, int32list, fast;
}
-static
-VolumeInfoCmd(name)
- char *name;
+static int
+VolumeInfoCmd(char *name)
{
struct nvldbentry entry;
afs_int32 vcode;
VolumeZap(register struct cmd_syndesc *as, void *arock)
{
struct nvldbentry entry;
- afs_int32 volid, code, server, part, zapbackupid = 0, backupid = 0, err;
+ afs_uint32 volid, zapbackupid = 0, backupid = 0;
+ afs_int32 code, server, part, err;
if (as->parms[3].items) {
/* force flag is on, use the other version */
}
int
-GetVolumeInfo(afs_int32 volid, afs_int32 *server, afs_int32 *part, afs_int32 *voltype,
+GetVolumeInfo(afs_uint32 volid, afs_int32 *server, afs_int32 *part, afs_int32 *voltype,
struct nvldbentry *rentry)
{
afs_int32 vcode;
DeleteEntry(register struct cmd_syndesc *as, void *arock)
{
afs_int32 apart = 0;
- afs_int32 avolid;
+ afs_uint32 avolid;
afs_int32 vcode;
struct VldbListByAttributes attributes;
nbulkentries arrayEntries;
static int
-CompareVldbEntryByName(p1, p2)
- char *p1, *p2;
+CompareVldbEntryByName(const void *p1, const void *p2)
{
struct nvldbentry *arg1, *arg2;
}
/*
-static int CompareVldbEntry(p1,p2)
-char *p1,*p2;
+static int CompareVldbEntry(char *p1, char *p2)
{
struct nvldbentry *arg1,*arg2;
int i;
static int
BackSys(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 apart = 0, avolid;
+ afs_uint32 avolid;
+ afs_int32 apart = 0;
afs_int32 aserver = 0, code, aserver1, apart1;
afs_int32 vcode;
struct VldbListByAttributes attributes;
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;
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;
register struct nvldbentry *vllist;
afs_int32 nentries;
int j;
- afs_int32 volid;
+ afs_uint32 volid;
afs_int32 totalE;
char pname[10];
exit(1);
}
fprintf(STDOUT,
- "Free space on partition %s: %lld K blocks out of total %lld\n",
+ "Free space on partition %s: %" AFS_INT64_FMT " K blocks out of total %" AFS_INT64_FMT "\n",
pname, partition.free, partition.minFree);
sumPartitions++;
AddUInt64(sumFree,partition.free,&sumFree);
m_addrs.bulkaddrs_val = 0;
m_addrs.bulkaddrs_len = 0;
vcode =
- ubik_VL_GetAddrsU(cstruct, 0, &m_attrs, &m_uuid,
+ ubik_VL_GetAddrsU(cstruct, 0, &m_attrs, m_uuid,
(afs_int32 *)&vlcb, &m_nentries, &m_addrs);
if (vcode) {
fprintf(STDERR,
static int
LockEntry(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, vcode, err;
+ afs_uint32 avolid;
+ afs_int32 vcode, err;
avolid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);
if (avolid == 0) {
ConvertRO(register struct cmd_syndesc *as, void *arock)
{
afs_int32 partition = -1;
- afs_int32 server, volid, code, i, same;
+ afs_uint32 volid;
+ afs_int32 server, code, i, same;
struct nvldbentry entry, storeEntry;
afs_int32 vcode;
afs_int32 rwindex = 0;
static int
Sizes(register struct cmd_syndesc *as, void *arock)
{
- afs_int32 avolid, aserver, apart, voltype, fromdate = 0, code, err, i;
+ afs_uint32 avolid;
+ afs_int32 aserver, apart, voltype, fromdate = 0, code, err, i;
struct nvldbentry entry;
volintSize vol_size;
}
int
-osi_audit()
+osi_audit(void)
{
/* this sucks but it works for now.
*/
#include "AFS_component_version_number.c"
-main(argc, argv)
- int argc;
- char **argv;
+int
+main(int argc, char **argv)
{
register afs_int32 code;
"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");
"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");
cmd_AddParm(ts, "-partition", CMD_SINGLE, 0,
"partition name for new site");
cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
- cmd_AddParm(ts, "-valid", CMD_FLAG, CMD_OPTIONAL | CMD_HIDE, "publish as an up-to-date site in VLDB");
+ cmd_AddParm(ts, "-valid", CMD_FLAG, CMD_OPTIONAL, "publish as an up-to-date site in VLDB");
COMMONPARMS;
ts = cmd_CreateSyntax("remsite", RemoveSite, NULL,
cmd_AddParm(ts, "-clearVolUpCounter", CMD_FLAG, CMD_OPTIONAL, "clear volUpdateCounter");
COMMONPARMS;
- ts = cmd_CreateSyntax("offline", volOffline, NULL, (char *)CMD_HIDDEN);
+ ts = cmd_CreateSyntax("offline", volOffline, NULL, "force the volume status to offline");
cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "server name");
cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
cmd_AddParm(ts, "-busy", CMD_FLAG, CMD_OPTIONAL, "busy volume");
COMMONPARMS;
- ts = cmd_CreateSyntax("online", volOnline, NULL, (char *)CMD_HIDDEN);
+ ts = cmd_CreateSyntax("online", volOnline, NULL, "force the volume status to online");
cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "server name");
cmd_AddParm(ts, "-partition", CMD_SINGLE, 0, "partition name");
cmd_AddParm(ts, "-id", CMD_SINGLE, 0, "volume name or ID");
"prefix of the volume whose VLDB entry is to be deleted");
cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_OPTIONAL, "machine name");
cmd_AddParm(ts, "-partition", CMD_SINGLE, CMD_OPTIONAL, "partition name");
- cmd_AddParm(ts, "-noexecute", CMD_FLAG, CMD_OPTIONAL | CMD_HIDE,
+ cmd_AddParm(ts, "-noexecute", CMD_FLAG, CMD_OPTIONAL,
"no execute");
COMMONPARMS;