};
/*map the partition <partId> into partition name <partName>*/
-void
-MapPartIdIntoName(partId, partName)
-afs_int32 partId;
-char *partName;
+void MapPartIdIntoName(afs_int32 partId, char *partName)
{
if(partId < 26) {/* what if partId > = 26 ? */
strcpy(partName,"/vicep");
}
}
-yesprompt(str)
-char *str;
+int yesprompt(char *str)
{
char response, c;
int code;
}
-PrintError(msg, errcode)
- char *msg;
- afs_int32 errcode;
+int PrintError(char *msg, afs_int32 errcode)
{
fprintf(STDERR,msg);
/*replace by a big switch statement*/
static struct rx_securityClass *uvclass=0;
static int uvindex = -1;
/* called by VLDBClient_Init to set the security module to be used in the RPC */
-UV_SetSecurity(as, aindex)
-register struct rx_securityClass *as;
-afs_int32 aindex; {
+int UV_SetSecurity(register struct rx_securityClass *as, afs_int32 aindex)
+{
uvindex = aindex;
uvclass = as;
}
/* bind to volser on <port> <aserver> */
/* takes server address in network order, port in host order. dumb */
-struct rx_connection *UV_Bind(aserver, port)
-afs_int32 aserver, port;
+struct rx_connection *UV_Bind(afs_int32 aserver, afs_int32 port)
{
register struct rx_connection *tc;
}
/* called by EmuerateEntry, show vldb entry in a reasonable format */
-void SubEnumerateEntry(entry)
-struct nvldbentry *entry;
+void SubEnumerateEntry(struct nvldbentry *entry)
{
int i;
char pname[10];
}
/*enumerate the vldb entry corresponding to <entry> */
-void EnumerateEntry(entry)
-struct nvldbentry *entry;
+void EnumerateEntry(struct nvldbentry *entry)
{
fprintf(STDOUT,"\n");
}
/* forcibly remove a volume. Very dangerous call */
-UV_NukeVolume(server, partid, volid)
-afs_int32 server;
-afs_int32 partid, volid; {
+int UV_NukeVolume(afs_int32 server, afs_int32 partid, afs_int32 volid)
+{
register struct rx_connection *tconn;
register afs_int32 code;
}
/* like df. Return usage of <pname> on <server> in <partition> */
-UV_PartitionInfo(server,pname,partition)
-afs_int32 server;
-char *pname;
-struct diskPartition *partition;
+int UV_PartitionInfo(afs_int32 server, char *pname, struct diskPartition *partition)
{
register struct rx_connection *aconn;
afs_int32 code;
}
/* old interface to create volume */
-UV_CreateVolume(aserver, apart, aname, anewid)
-afs_int32 apart, aserver;
-char *aname;
-afs_int32 *anewid;
+int UV_CreateVolume(afs_int32 aserver, afs_int32 apart, char *aname, afs_int32 *anewid)
{
afs_int32 code;
code = UV_CreateVolume2(aserver, apart, aname, 5000, 0, 0, 0, 0, anewid);
/* create a volume, given a server, partition number, volume name --> sends
* back new vol id in <anewid>*/
-UV_CreateVolume2(aserver, apart, aname, aquota, aspare1, aspare2, aspare3, aspare4, anewid)
-afs_int32 apart, aserver;
-afs_int32 aspare1, aspare2, aspare3, aspare4;
-afs_int32 aquota;
-char *aname;
-afs_int32 *anewid;
+int UV_CreateVolume2(afs_int32 aserver, afs_int32 apart, char *aname, afs_int32 aquota,
+ afs_int32 aspare1, afs_int32 aspare2, afs_int32 aspare3, afs_int32 aspare4, afs_int32 *anewid)
{
register struct rx_connection *aconn;
}
/* create a volume, given a server, partition number, volume name --> sends
* back new vol id in <anewid>*/
-UV_AddVLDBEntry(aserver, apart, aname, aid)
- afs_int32 apart, aserver;
- char *aname;
- afs_int32 aid;
+int UV_AddVLDBEntry(afs_int32 aserver, afs_int32 apart, char *aname, afs_int32 aid)
{
register struct rx_connection *aconn;
afs_int32 error;
* the physical entry gets removed from the vldb only if the ref count
* becomes zero
*/
-UV_DeleteVolume(aserver, apart, avolid)
- afs_int32 aserver, apart, avolid;
+int UV_DeleteVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid)
{
struct rx_connection *aconn = (struct rx_connection *)0;
afs_int32 ttid = 0;
jmp_buf env;
int interrupt=0;
-void sigint_handler(x)
+void sigint_handler(int x)
{
if(interrupt)
longjmp(env,0);
* if one already exists, update it
*/
-UV_BackupVolume(aserver, apart, avolid)
- afs_int32 aserver, apart, avolid;
+int UV_BackupVolume(afs_int32 aserver, afs_int32 apart, afs_int32 avolid)
{
struct rx_connection *aconn = (struct rx_connection *)0;
afs_int32 ttid = 0, btid = 0;
return error;
}
-static int DelVol (conn, vid, part, flags)
-struct rx_connection *conn;
-afs_int32 vid, part, flags;
+static int DelVol (struct rx_connection *conn, afs_int32 vid, afs_int32 part, afs_int32 flags)
{
afs_int32 acode, ccode, rcode, tid;
ccode = rcode = tid = 0;
* if necessary. Return the time from which a dump should
* be made (0 if it's a new volume)
*/
-static int GetTrans (vldbEntryPtr, index, connPtr, transPtr, timePtr)
- struct nvldbentry *vldbEntryPtr;
- afs_int32 index;
- struct rx_connection **connPtr;
- afs_int32 *transPtr, *timePtr;
+static int GetTrans (struct nvldbentry *vldbEntryPtr, afs_int32 index, struct rx_connection **connPtr,
+ afs_int32 *transPtr, afs_int32 *timePtr)
{
afs_int32 volid;
struct volser_status tstatus;
return code;
}
-static int SimulateForwardMultiple(fromconn, fromtid, fromdate, tr,
- flags, cookie, results)
-struct rx_connection *fromconn;
-afs_int32 fromtid, fromdate, flags;
-manyDests *tr;
-void *cookie;
-manyResults *results;
+static int SimulateForwardMultiple(struct rx_connection *fromconn, afs_int32 fromtid,
+ afs_int32 fromdate, manyDests *tr, afs_int32 flags, void *cookie, manyResults *results)
{
int i;
}
-static int rel_compar (r1, r2)
- struct release *r1, *r2;
+static int rel_compar (struct release *r1, struct release *r2)
{
return (r1->time - r2->time);
}
* the time: Influences when we write back the VLDB entry.
*/
-UV_ReleaseVolume(afromvol, afromserver, afrompart, forceflag)
- afs_int32 afromserver;
- afs_int32 afrompart;
- afs_int32 afromvol;
- int forceflag;
+int UV_ReleaseVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart, int forceflag)
{
char vname[64];
afs_int32 code, vcode, rcode, tcode;
* DumpFunction does the real work behind the scenes after
* extracting parameters from the rock
*/
-UV_DumpVolume(afromvol, afromserver, afrompart, fromdate, DumpFunction, rock)
- afs_int32 afromserver;
- afs_int32 afrompart;
- afs_int32 afromvol;
- afs_int32 fromdate;
- afs_int32 (*DumpFunction)();
- char *rock;
+int UV_DumpVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
+ afs_int32 fromdate, afs_int32 (*DumpFunction)(), char *rock)
{
struct rx_connection *fromconn = (struct rx_connection *)0;
struct rx_call *fromcall = (struct rx_call *)0;
* the dump file <afilename>. WriteData does all the real work
* after extracting params from the rock
*/
-UV_RestoreVolume(toserver, topart, tovolid, tovolname, flags, WriteData, rock)
- afs_int32 toserver, topart, tovolid;
- char tovolname[];
- int flags;
- afs_int32 (*WriteData)();
- char *rock;
+int UV_RestoreVolume(afs_int32 toserver, afs_int32 topart, afs_int32 tovolid,
+ char tovolname[], int flags, afs_int32 (*WriteData)(), char *rock)
{
struct rx_connection *toconn,*tempconn;
struct rx_call *tocall;
/*unlocks the vldb entry associated with <volid> */
-UV_LockRelease(volid)
-afs_int32 volid;
+int UV_LockRelease(afs_int32 volid)
{
/*adds <server> and <part> as a readonly replication site for <volid>
*in vldb */
-UV_AddSite(server, part, volid)
-afs_int32 server, part, volid;
+int UV_AddSite(afs_int32 server, afs_int32 part, afs_int32 volid)
{
int j, nro=0, islocked=0;
struct nvldbentry entry,storeEntry;
}
/*removes <server> <part> as read only site for <volid> from the vldb */
-UV_RemoveSite(server, part, volid)
-afs_int32 server, part, volid;
+int UV_RemoveSite(afs_int32 server, afs_int32 part, afs_int32 volid)
{
afs_int32 vcode;
struct nvldbentry entry,storeEntry;
}
/*sets <server> <part> as read/write site for <volid> in the vldb */
-UV_ChangeLocation(server, part, volid)
-afs_int32 server, part, volid;
+int UV_ChangeLocation(afs_int32 server, afs_int32 part, afs_int32 volid)
{
afs_int32 vcode;
struct nvldbentry entry,storeEntry;
}
/*list all the partitions on <aserver> */
-UV_ListPartitions(aserver, ptrPartList, cntp)
- afs_int32 aserver;
- struct partList *ptrPartList;
- afs_int32 *cntp;
+int UV_ListPartitions(afs_int32 aserver, struct partList *ptrPartList, afs_int32 *cntp)
{
struct rx_connection *aconn;
struct pIDs partIds;
/*zap the list of volumes specified by volPtrArray (the volCloneId field).
This is used by the backup system */
-UV_ZapVolumeClones(aserver,apart,volPtr,arraySize)
-afs_int32 aserver, apart;
-afs_int32 arraySize;
-struct volDescription *volPtr;
+int UV_ZapVolumeClones(afs_int32 aserver, afs_int32 apart, struct volDescription *volPtr, afs_int32 arraySize)
{
struct rx_connection *aconn;
struct volDescription *curPtr;
/*return a list of clones of the volumes specified by volPtrArray. Used by the
backup system */
-UV_GenerateVolumeClones(aserver,apart,volPtr,arraySize)
-afs_int32 aserver, apart;
-afs_int32 arraySize;
-struct volDescription *volPtr;
+int UV_GenerateVolumeClones(afs_int32 aserver, afs_int32 apart, struct volDescription *volPtr, afs_int32 arraySize)
{
struct rx_connection *aconn;
struct volDescription *curPtr;
/*list all the volumes on <aserver> and <apart>. If all = 1, then all the
* relevant fields of the volume are also returned. This is a heavy weight operation.*/
-UV_ListVolumes(aserver,apart,all,resultPtr,size)
-afs_int32 aserver, apart;
-int all ;
-struct volintInfo **resultPtr;
-afs_int32 *size;
+int UV_ListVolumes(afs_int32 aserver, afs_int32 apart, int all, struct volintInfo **resultPtr, afs_int32 *size)
{
struct rx_connection *aconn;
afs_int32 code = 0;
* As advertised.
*------------------------------------------------------------------------*/
-UV_XListVolumes(a_serverID, a_partID, a_all, a_resultPP, a_numEntsInResultP)
- afs_int32 a_serverID;
- afs_int32 a_partID;
- int a_all;
- struct volintXInfo **a_resultPP;
- afs_int32 *a_numEntsInResultP;
-
-{ /*UV_XListVolumes*/
-
+int UV_XListVolumes(afs_int32 a_serverID, afs_int32 a_partID, int a_all,
+ struct volintXInfo **a_resultPP, afs_int32 *a_numEntsInResultP)
+{
struct rx_connection *rxConnP; /*Ptr to the Rx connection involved*/
afs_int32 code; /*Error code to return*/
volXEntries volumeXInfo; /*Area for returned extended vol info*/
} /*UV_XListVolumes*/
/* get all the information about volume <volid> on <aserver> and <apart> */
-UV_ListOneVolume(aserver,apart,volid,resultPtr)
-afs_int32 aserver, apart;
-afs_int32 volid;
-struct volintInfo **resultPtr;
+int UV_ListOneVolume(afs_int32 aserver, afs_int32 apart, afs_int32 volid, struct volintInfo **resultPtr)
{
struct rx_connection *aconn;
afs_int32 code = 0;
* As advertised.
*------------------------------------------------------------------------*/
-UV_XListOneVolume(a_serverID, a_partID, a_volID, a_resultPP)
- afs_int32 a_serverID;
- afs_int32 a_partID;
- afs_int32 a_volID;
- struct volintXInfo **a_resultPP;
-
-{ /*UV_XListOneVolume*/
+int UV_XListOneVolume(afs_int32 a_serverID, afs_int32 a_partID,
+ afs_int32 a_volID, struct volintXInfo **a_resultPP)
+{
struct rx_connection *rxConnP; /*Rx connection to Volume Server*/
afs_int32 code; /*Error code*/
volXEntries volumeXInfo; /*Area for returned info*/
PrintError("",code);
return code;
-} /*UV_XListOneVolume*/
+}
/* CheckVolume()
* Given a volume we read from a partition, check if it is
* VLDB entries are locked only when a change needs to be done.
* Output changed to look a lot like the "vos syncserv" otuput.
*/
-static afs_int32 CheckVolume(volumeinfo, aserver, apart, modentry, maxvolid)
- volintInfo *volumeinfo;
- afs_int32 aserver, apart;
- afs_int32 *modentry;
- afs_uint32 *maxvolid;
+static afs_int32 CheckVolume(volintInfo *volumeinfo, afs_int32 aserver, afs_int32 apart,
+ afs_int32 *modentry, afs_uint32 *maxvolid)
{
int idx, j;
afs_int32 code, error = 0;
return(error);
}
-int sortVolumes(v1, v2)
- volintInfo *v1, *v2;
+int sortVolumes(const void *a, const void *b)
{
+ volintInfo *v1 = (volintInfo *)a;
+ volintInfo *v2 = (volintInfo *)b;
afs_int32 rwvolid1, rwvolid2;
rwvolid1 = ((v1->type == RWVOL) ? v1->volid : v1->parentID);
* Checks the VLDB entry (similar to syncserv) as well as checks
* if the volume exists on specified servers (similar to syncvldb).
*/
-UV_SyncVolume(aserver, apart, avolname, flags)
- afs_int32 aserver, apart;
- char *avolname;
- int flags;
+int UV_SyncVolume(afs_int32 aserver, afs_int32 apart, char *avolname, int flags)
{
struct rx_connection *aconn = 0;
afs_int32 j, k, code, vcode, error = 0;
* Synchronise vldb with the file server <aserver> and,
* optionally, <apart>.
*/
-UV_SyncVldb(aserver, apart, flags, force)
- afs_int32 aserver, apart;
- int flags, force;
+int UV_SyncVldb(afs_int32 aserver, afs_int32 apart, int flags, int force)
{
struct rx_connection *aconn;
afs_int32 code, error=0;
* Some error codes mean the volume is unavailable but
* still exists - so we catch these error codes.
*/
-afs_int32 VolumeExists(server, partition, volumeid)
- afs_int32 server, partition, volumeid;
+afs_int32 VolumeExists(afs_int32 server, afs_int32 partition, afs_int32 volumeid)
{
struct rx_connection *conn=(struct rx_connection *)0;
afs_int32 code = -1;
/* CheckVldbRWBK()
*
*/
-afs_int32 CheckVldbRWBK(entry, modified)
- struct nvldbentry *entry;
- afs_int32 *modified;
+afs_int32 CheckVldbRWBK(struct nvldbentry *entry, afs_int32 *modified)
{
int modentry = 0;
int idx;
return(error);
}
-CheckVldbRO(entry, modified)
- struct nvldbentry *entry;
- afs_int32 *modified;
+int CheckVldbRO(struct nvldbentry *entry, afs_int32 *modified)
{
int idx;
int foundro = 0, modentry = 0;
/* CheckVldb()
* Ensure that <entry> matches with the info on file servers
*/
-afs_int32 CheckVldb(entry, modified)
- struct nvldbentry *entry;
- afs_int32 *modified;
+afs_int32 CheckVldb(struct nvldbentry *entry, afs_int32 *modified)
{
afs_int32 code, error=0;
struct nvldbentry storeEntry;
/* UV_SyncServer()
* Synchronise <aserver> <apart>(if flags = 1) with the VLDB.
*/
-UV_SyncServer(aserver, apart, flags, force)
- afs_int32 aserver, apart;
- int flags, force;
+int UV_SyncServer(afs_int32 aserver, afs_int32 apart, int flags, int force)
{
struct rx_connection *aconn;
afs_int32 code, error = 0;
*readonly and backup volumes. This operation is also idempotent.
*salvager is capable of recovering from rename operation stopping halfway.
*to recover run syncserver on the affected machines,it will force renaming to completion. name clashes should have been detected before calling this proc */
-UV_RenameVolume(entry,oldname,newname)
-struct nvldbentry *entry;
-char oldname[],newname[];
+int UV_RenameVolume(struct nvldbentry *entry, char oldname[], char newname[])
{
struct nvldbentry storeEntry;
afs_int32 vcode,code,rcode,error;
}
/*report on all the active transactions on volser */
-UV_VolserStatus(server,rpntr,rcount)
-afs_int32 server;
-transDebugInfo **rpntr;
-afs_int32 *rcount;
+int UV_VolserStatus(afs_int32 server, transDebugInfo **rpntr, afs_int32 *rcount)
{
struct rx_connection *aconn;
transDebugEntries transInfo;
}
-/*delete the volume without interacting with the vldb */
-UV_VolumeZap(server,part,volid)
-afs_int32 volid,server,part;
+/*delete the volume without interacting with the vldb */
+int UV_VolumeZap(afs_int32 server, afs_int32 part, afs_int32 volid)
{
afs_int32 rcode,ttid,error,code;
struct rx_connection *aconn;
return error;
}
-UV_SetVolume(server, partition, volid, transflag, setflag, sleeptime)
- afs_int32 server, partition, volid, transflag, setflag;
+int UV_SetVolume(afs_int32 server, afs_int32 partition, afs_int32 volid, afs_int32 transflag, afs_int32 setflag, int sleeptime)
{
struct rx_connection *conn = 0;
afs_int32 tid=0;
return(error);
}
-UV_SetVolumeInfo(server, partition, volid, infop)
- afs_int32 server, partition, volid;
- volintInfo *infop;
+int UV_SetVolumeInfo(afs_int32 server, afs_int32 partition, afs_int32 volid, volintInfo *infop)
{
struct rx_connection *conn = 0;
afs_int32 tid=0;
/*maps the host addresses in <old > (present in network byte order) to
that in< new> (present in host byte order )*/
-void
-MapNetworkToHost(old, new)
-struct nvldbentry *old, *new;
+void MapNetworkToHost(struct nvldbentry *old, struct nvldbentry *new)
{
int i,count;
}
/*maps the host entries in <entry> which are present in host byte order to network byte order */
-void
-MapHostToNetwork(entry)
-struct nvldbentry *entry;
+void MapHostToNetwork(struct nvldbentry *entry)
{
int i,count;