* directory or online at http://www.openafs.org/dl/license10.html
*/
-#include <afs/param.h>
#include <afsconfig.h>
+#include <afs/param.h>
RCSID("$Header$");
/* Create a new vldb entry; both new volume id and name must be unique (non-existant in vldb). */
-VL_CreateEntry(rxcall, newentry)
+SVL_CreateEntry(rxcall, newentry)
struct rx_call *rxcall;
struct vldbentry *newentry;
{ struct ubik_trans *trans;
goto abort;
}
- bzero(&tentry, sizeof(struct nvlentry));
+ memset(&tentry, 0, sizeof(struct nvlentry));
/* Convert to its internal representation; both in host byte order */
if (errorcode = vldbentry_to_vlentry(trans, newentry, &tentry)) {
FreeBlock(trans, blockindex);
}
-VL_CreateEntryN(rxcall, newentry)
+SVL_CreateEntryN(rxcall, newentry)
struct rx_call *rxcall;
struct nvldbentry *newentry;
{ struct ubik_trans *trans;
goto abort;
}
- bzero(&tentry, sizeof(struct nvlentry));
+ memset(&tentry, 0, sizeof(struct nvlentry));
/* Convert to its internal representation; both in host byte order */
if (errorcode = nvldbentry_to_vlentry(trans, newentry, &tentry)) {
FreeBlock(trans, blockindex);
}
-VL_ChangeAddr(rxcall, ip1, ip2)
+SVL_ChangeAddr(rxcall, ip1, ip2)
struct rx_call *rxcall;
afs_int32 ip1, ip2;
{ struct ubik_trans *trans;
- afs_int32 errorcode, blockindex;
- struct nvlentry tentry;
+ afs_int32 errorcode;
COUNT_REQ (VLCHANGEADDR);
if (!afsconf_SuperUser(vldb_confdir, rxcall, (char *)0)) {
}
/* Delete a vldb entry given the volume id. */
-VL_DeleteEntry(rxcall, volid, voltype)
+SVL_DeleteEntry(rxcall, volid, voltype)
struct rx_call *rxcall;
afs_int32 volid;
afs_int32 voltype;
return(ubik_EndTrans(trans));
}
-VL_GetEntryByID (rxcall, volid, voltype, aentry)
+SVL_GetEntryByID (rxcall, volid, voltype, aentry)
struct rx_call *rxcall;
afs_int32 volid, voltype;
vldbentry *aentry; /* entry data copied here */
return (GetEntryByID(rxcall, volid, voltype, (char *)aentry, 0, this_op));
}
-VL_GetEntryByIDN (rxcall, volid, voltype, aentry)
+SVL_GetEntryByIDN (rxcall, volid, voltype, aentry)
struct rx_call *rxcall;
afs_int32 volid, voltype;
nvldbentry *aentry; /* entry data copied here */
return (GetEntryByID(rxcall, volid, voltype, (char *)aentry, 1, this_op));
}
-VL_GetEntryByIDU (rxcall, volid, voltype, aentry)
+SVL_GetEntryByIDU (rxcall, volid, voltype, aentry)
struct rx_call *rxcall;
afs_int32 volid, voltype;
uvldbentry *aentry; /* entry data copied here */
return(ubik_EndTrans(trans));
}
-VL_GetEntryByNameO (rxcall, volname, aentry)
+SVL_GetEntryByNameO (rxcall, volname, aentry)
struct rx_call *rxcall;
char *volname;
struct vldbentry *aentry; /* entry data copied here */
}
-VL_GetEntryByNameN (rxcall, volname, aentry)
+SVL_GetEntryByNameN (rxcall, volname, aentry)
struct rx_call *rxcall;
char *volname;
struct nvldbentry *aentry; /* entry data copied here */
return (GetEntryByName(rxcall, volname, (char *)aentry, 1, this_op));
}
-VL_GetEntryByNameU (rxcall, volname, aentry)
+SVL_GetEntryByNameU (rxcall, volname, aentry)
struct rx_call *rxcall;
char *volname;
struct uvldbentry *aentry; /* entry data copied here */
/* Get the current value of the maximum volume id and bump the volume id counter by Maxvolidbump. */
-VL_GetNewVolumeId (rxcall, Maxvolidbump, newvolumeid)
+SVL_GetNewVolumeId (rxcall, Maxvolidbump, newvolumeid)
struct rx_call *rxcall;
afs_int32 Maxvolidbump;
afs_int32 *newvolumeid;
* newentry. No individual checking/updating per field (alike
* VLUpdateEntry) is done. */
-VL_ReplaceEntry (rxcall, volid, voltype, newentry, releasetype)
+SVL_ReplaceEntry (rxcall, volid, voltype, newentry, releasetype)
struct rx_call *rxcall;
afs_int32 volid;
afs_int32 voltype;
return errorcode;
}
-VL_ReplaceEntryN (rxcall, volid, voltype, newentry, releasetype)
+SVL_ReplaceEntryN (rxcall, volid, voltype, newentry, releasetype)
struct rx_call *rxcall;
afs_int32 volid;
afs_int32 voltype;
/* Update a vldb entry (accessed thru its volume id). Almost all of the entry's fields can be modified in a single call by setting the appropriate bits in the Mask field in VldbUpdateentry. */
/* this routine may never have been tested; use replace entry instead unless you're brave */
-VL_UpdateEntry (rxcall, volid, voltype, updateentry, releasetype)
+SVL_UpdateEntry (rxcall, volid, voltype, updateentry, releasetype)
struct rx_call *rxcall;
afs_int32 volid;
afs_int32 voltype;
}
-VL_UpdateEntryByName (rxcall, volname, updateentry, releasetype)
+SVL_UpdateEntryByName (rxcall, volname, updateentry, releasetype)
struct rx_call *rxcall;
char *volname;
afs_int32 releasetype;
/* Set a lock to the vldb entry for volid (of type voltype if not -1). */
-VL_SetLock (rxcall, volid, voltype, voloper)
+SVL_SetLock (rxcall, volid, voltype, voloper)
struct rx_call *rxcall;
afs_int32 volid;
afs_int32 voltype;
* fields (afsid and/or volume operation) will be cleared along with
* the lock time stamp. */
-VL_ReleaseLock (rxcall, volid, voltype, releasetype)
+SVL_ReleaseLock (rxcall, volid, voltype, releasetype)
struct rx_call *rxcall;
afs_int32 volid;
afs_int32 voltype;
/* ListEntry returns a single vldb entry, aentry, with offset previous_index; the remaining parameters (i.e. next_index) are used so that sequential calls to this routine will get the next (all) vldb entries. */
-VL_ListEntry (rxcall, previous_index, count, next_index, aentry)
+SVL_ListEntry (rxcall, previous_index, count, next_index, aentry)
struct rx_call *rxcall;
afs_int32 previous_index;
afs_int32 *count;
}
/* ListEntry returns a single vldb entry, aentry, with offset previous_index; the remaining parameters (i.e. next_index) are used so that sequential calls to this routine will get the next (all) vldb entries. */
-VL_ListEntryN (rxcall, previous_index, count, next_index, aentry)
+SVL_ListEntryN (rxcall, previous_index, count, next_index, aentry)
struct rx_call *rxcall;
afs_int32 previous_index;
afs_int32 *count;
/* Retrieves in vldbentries all vldb entries that match the specified attributes (by server number, partition, volume type, and flag); if volume id is specified then the associated list for that entry is returned. CAUTION: This could be a very expensive call since in most cases sequential search of all vldb entries is performed. */
-VL_ListAttributes(rxcall, attributes, nentries, vldbentries)
+SVL_ListAttributes(rxcall, attributes, nentries, vldbentries)
struct rx_call *rxcall;
struct VldbListByAttributes *attributes;
afs_int32 *nentries;
VldbentryLast = VldbentryFirst + allocCount;
/* Handle the attribute by volume id totally separate of the rest (thus additional Mask values are ignored if VLLIST_VOLUMEID is set!) */
if (attributes->Mask & VLLIST_VOLUMEID) {
- afs_int32 blockindex, chain;
- struct nvlentry tempentry;
+ afs_int32 blockindex;
blockindex = FindByID(trans, attributes->volumeid, -1, &tentry, &errorcode);
if (blockindex == 0) {
return(ubik_EndTrans(trans));
}
-VL_ListAttributesN(rxcall, attributes, nentries, vldbentries)
+SVL_ListAttributesN(rxcall, attributes, nentries, vldbentries)
struct rx_call *rxcall;
struct VldbListByAttributes *attributes;
afs_int32 *nentries;
VldbentryLast = VldbentryFirst + allocCount;
/* Handle the attribute by volume id totally separate of the rest (thus additional Mask values are ignored if VLLIST_VOLUMEID is set!) */
if (attributes->Mask & VLLIST_VOLUMEID) {
- afs_int32 blockindex, chain;
- struct nvlentry tempentry;
+ afs_int32 blockindex;
blockindex = FindByID(trans, attributes->volumeid, -1, &tentry, &errorcode);
if (blockindex == 0) {
}
-VL_ListAttributesN2(rxcall, attributes, name, startindex, nentries, vldbentries, nextstartindex)
+SVL_ListAttributesN2(rxcall, attributes, name, startindex, nentries, vldbentries, nextstartindex)
struct rx_call *rxcall;
struct VldbListByAttributes *attributes;
char * name; /* Wildcarded volume name */
int errorcode=0, maxCount=VLDBALLOCCOUNT;
struct ubik_trans *trans;
struct nvlentry tentry;
- struct nvldbentry *Vldbentry=0, *VldbentryFirst=0, *VldbentryLast=0, tVldbentry;
+ struct nvldbentry *Vldbentry=0, *VldbentryFirst=0, *VldbentryLast=0;
afs_int32 blockindex=0, count=0, k, match, matchindex;
int serverindex=-1; /* no server found */
int findserver=0, findpartition=0, findflag=0, findname=0;
* returned. CAUTION: This could be a very expensive call since in most
* cases sequential search of all vldb entries is performed.
*/
-VL_LinkedList(rxcall, attributes, nentries, vldbentries)
+SVL_LinkedList(rxcall, attributes, nentries, vldbentries)
struct rx_call *rxcall;
struct VldbListByAttributes *attributes;
afs_int32 *nentries;
return(ubik_EndTrans(trans));
}
-VL_LinkedListN(rxcall, attributes, nentries, vldbentries)
+SVL_LinkedListN(rxcall, attributes, nentries, vldbentries)
struct rx_call *rxcall;
struct VldbListByAttributes *attributes;
afs_int32 *nentries;
}
/* Get back vldb header statistics (allocs, frees, maxvolumeid, totalentries, etc) and dynamic statistics (number of requests and/or aborts per remote procedure call, etc) */
-VL_GetStats(rxcall, stats, vital_header)
+SVL_GetStats(rxcall, stats, vital_header)
struct rx_call *rxcall;
vldstats *stats;
vital_vlheader *vital_header;
if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
return errorcode;
VLog(5, ("GetStats %\n", rxinfo(rxcall)));
- bcopy((char *)&cheader.vital_header, (char *) vital_header, sizeof(vital_vlheader));
- bcopy((char *)&dynamic_statistics, (char *) stats, sizeof(vldstats));
+ memcpy((char *) vital_header, (char *)&cheader.vital_header, sizeof(vital_vlheader));
+ memcpy((char *) stats, (char *)&dynamic_statistics, sizeof(vldstats));
return(ubik_EndTrans(trans));
}
* easy to do. In the future, it might require a little bit of grunging
* through the VLDB, but that's life.
*/
-VL_GetAddrs(rxcall, Handle, spare2, spare3, nentries, addrsp)
+SVL_GetAddrs(rxcall, Handle, spare2, spare3, nentries, addrsp)
struct rx_call *rxcall;
afs_int32 Handle, spare2;
struct VLCallBack *spare3;
COUNT_REQ(VLGETADDRS);
addrsp->bulkaddrs_len = *nentries = 0;
addrsp->bulkaddrs_val = 0;
- bzero (spare3, sizeof (struct VLCallBack));
+ memset(spare3, 0, sizeof (struct VLCallBack));
if (errorcode = Init_VLdbase(&trans, LOCKREAD, this_op))
return errorcode;
#define PADDR(addr) printf("%d.%d.%d.%d", (addr>>24)&0xff, (addr>>16)&0xff, (addr>>8) &0xff, addr&0xff);
-VL_RegisterAddrs(rxcall, uuidp, spare1, addrsp)
+SVL_RegisterAddrs(rxcall, uuidp, spare1, addrsp)
struct rx_call *rxcall;
afsUUID *uuidp;
afs_int32 spare1;
{
afs_int32 code;
struct ubik_trans *trans;
- int cnt, h, i, j, k, m, hostslot, base, index;
+ int cnt, h, i, j, k, m, base, index;
struct extentaddr *exp = 0, *tex;
afsUUID tuuid;
afs_uint32 addrs[VL_MAXIPADDRS_PERMH];
- afs_int32 fbase, findex;
+ afs_int32 fbase;
int count, willChangeEntry, foundUuidEntry, willReplaceCnt;
int WillReplaceEntry, WillChange[MAXSERVERID+1], FoundUuid, ReplaceEntry;
int srvidx, mhidx;
return(ubik_EndTrans(trans));
}
-VL_GetAddrsU(rxcall, attributes, uuidpo, uniquifier, nentries, addrsp)
+SVL_GetAddrsU(rxcall, attributes, uuidpo, uniquifier, nentries, addrsp)
struct rx_call *rxcall;
struct ListAddrByAttributes *attributes;
afsUUID *uuidpo;
afs_int32 *uniquifier, *nentries;
bulkaddrs *addrsp;
-{ register afs_int32 errorcode, index=-1, op, offset;
+{ register afs_int32 errorcode, index=-1, offset;
struct ubik_trans *trans;
- int nservers, i, j, k, base=0;
+ int nservers, i, j, base=0;
struct extentaddr *exp=0;
afsUUID tuuid;
afs_uint32 *taddrp, taddr;
{
int i, j;
- bzero(VldbEntry, sizeof(struct vldbentry));
+ memset(VldbEntry, 0, sizeof(struct vldbentry));
strncpy(VldbEntry->name, VlEntry->name, sizeof(VldbEntry->name));
for (i=0; i < OMAXNSERVERS; i++) {
if (VlEntry->serverNumber[i] == BADSERVERID) break;
{
int i, j;
- bzero(VldbEntry, sizeof(struct vldbentry));
+ memset(VldbEntry, 0, sizeof(struct vldbentry));
strncpy(VldbEntry->name, VlEntry->name, sizeof(VldbEntry->name));
for (i=0; i < NMAXNSERVERS; i++) {
if (VlEntry->serverNumber[i] == BADSERVERID) break;
{
int i, j;
- bzero(VldbEntry, sizeof(struct vldbentry));
+ memset(VldbEntry, 0, sizeof(struct vldbentry));
strncpy(VldbEntry->name, VlEntry->name, sizeof(VldbEntry->name));
for (i=0; i < NMAXNSERVERS; i++) {
if (VlEntry->serverNumber[i] == BADSERVERID) break;
int base, index, mhidx;
afsUUID tuuid;
afs_int32 blockindex, count;
- int pollcount;
+ int pollcount = 0;
struct nvlentry tentry;
if (!atrans)
/* Change the registered uuuid addresses */
if (exp) {
- bzero(&tuuid, sizeof(afsUUID));
+ memset(&tuuid, 0, sizeof(afsUUID));
afs_htonuuid(&tuuid);
exp->ex_hostuuid = tuuid;
code = vlwrite(atrans, DOFFSET(ntohl(ex_addr[0]->ex_contaddrs[base]),
}
/* see if the vlserver is back yet */
-VL_ProbeServer(rxcall)
+SVL_ProbeServer(rxcall)
struct rx_call *rxcall; {
return 0;
}