aconn = UV_Bind(aserver, AFSCONF_VOLUMEPORT);
/* next the next 3 available ids from the VLDB */
- vcode = ubik_Call(VL_GetNewVolumeId, cstruct, 0, 3, anewid);
+ vcode = ubik_VL_GetNewVolumeId(cstruct, 0, 3, anewid);
EGOTO1(cfail, vcode, "Could not get an Id for volume %s\n", aname);
code =
int notondisk = 0, notinvldb = 0;
/* Find and read bhe VLDB entry for this volume */
- code = ubik_Call(VL_SetLock, cstruct, 0, avolid, avoltype, VLOP_DELETE);
+ code = ubik_VL_SetLock(cstruct, 0, avolid, avoltype, VLOP_DELETE);
if (code) {
if (code != VL_NOENT) {
EGOTO1(error_exit, code,
fprintf(STDOUT,
"Last reference to the VLDB entry for %lu - deleting entry\n",
(unsigned long)avolid);
- code = ubik_Call(VL_DeleteEntry, cstruct, 0, avolid, vtype);
+ code = ubik_VL_DeleteEntry(cstruct, 0, avolid, vtype);
EGOTO1(error_exit, code,
"Could not delete the VLDB entry for the volume %u \n",
avolid);
if (islocked) {
code =
- ubik_Call(VL_ReleaseLock, cstruct, 0, avolid, -1,
- (LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
+ ubik_VL_ReleaseLock(cstruct, 0, avolid, -1,
+ (LOCKREL_OPCODE | LOCKREL_AFSID |
+ LOCKREL_TIMESTAMP));
if (code) {
EPRINT1(code,
"Could not release the lock on the VLDB entry for the volume %u \n",
exit(1);
}
- vcode = ubik_Call(VL_SetLock, cstruct, 0, afromvol, RWVOL, VLOP_MOVE);
+ vcode = ubik_VL_SetLock(cstruct, 0, afromvol, RWVOL, VLOP_MOVE);
EGOTO1(mfail, vcode, "Could not lock entry for volume %u \n", afromvol);
islocked = 1;
}
}
vcode =
- ubik_Call(VL_ReleaseLock, cstruct, 0, afromvol, -1,
+ ubik_VL_ReleaseLock(cstruct, 0, afromvol, -1,
(LOCKREL_OPCODE | LOCKREL_AFSID |
LOCKREL_TIMESTAMP));
EGOTO1(mfail, vcode,
VPRINT1("Allocating new volume id for clone of volume %u ...",
afromvol);
newVol = 0;
- vcode = ubik_Call(VL_GetNewVolumeId, cstruct, 0, 1, &newVol);
+ vcode = ubik_VL_GetNewVolumeId(cstruct, 0, 1, &newVol);
EGOTO1(mfail, vcode,
"Could not get an ID for the clone of volume %u from the VLDB\n",
afromvol);
if (islocked) {
VPRINT1("Cleanup: Releasing VLDB lock on volume %u ...", afromvol);
vcode =
- ubik_Call(VL_ReleaseLock, cstruct, 0, afromvol, -1,
+ ubik_VL_ReleaseLock(cstruct, 0, afromvol, -1,
(LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
if (vcode) {
VPRINT("\n");
/* unlock VLDB entry */
if (islocked) {
VPRINT1("Recovery: Releasing VLDB lock on volume %u ...", afromvol);
- ubik_Call(VL_ReleaseLock, cstruct, 0, afromvol, -1,
+ ubik_VL_ReleaseLock(cstruct, 0, afromvol, -1,
(LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
VDONE;
}
/* unlock VLDB entry */
VPRINT1("Recovery: Releasing lock on VLDB entry for volume %u ...",
afromvol);
- ubik_Call(VL_ReleaseLock, cstruct, 0, afromvol, -1,
+ ubik_VL_ReleaseLock(cstruct, 0, afromvol, -1,
(LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
VDONE;
VPRINT1("Allocating new volume id for clone of volume %u ...",
afromvol);
cloneVol = 0;
- vcode = ubik_Call(VL_GetNewVolumeId, cstruct, 0, 1, &cloneVol);
+ vcode = ubik_VL_GetNewVolumeId(cstruct, 0, 1, &cloneVol);
EGOTO1(mfail, vcode,
"Could not get an ID for the clone of volume %u from the VLDB\n",
afromvol);
/* Get a new volume id */
VPRINT1("Allocating new volume id for copy of volume %u ...", afromvol);
newVol = 0;
- vcode = ubik_Call(VL_GetNewVolumeId, cstruct, 0, 1, &newVol);
+ vcode = ubik_VL_GetNewVolumeId(cstruct, 0, 1, &newVol);
EGOTO1(mfail, vcode,
"Could not get an ID for the copy of volume %u from the VLDB\n",
afromvol);
(entry.flags & VLOP_ALLOPERS) || /* vldb lock already held */
(entry.volumeId[BACKVOL] == INVALID_BID)) { /* no assigned backup volume id */
- code = ubik_Call(VL_SetLock, cstruct, 0, avolid, RWVOL, VLOP_BACKUP);
+ code = ubik_VL_SetLock(cstruct, 0, avolid, RWVOL, VLOP_BACKUP);
if (code) {
fprintf(STDERR,
"Could not lock the VLDB entry for the volume %lu\n",
/* Get a backup volume id from the VLDB and update the vldb
* entry with it.
*/
- code = ubik_Call(VL_GetNewVolumeId, cstruct, 0, 1, &backupID);
+ code = ubik_VL_GetNewVolumeId(cstruct, 0, 1, &backupID);
if (code) {
fprintf(STDERR,
"Could not allocate ID for the backup volume of %lu from the VLDB\n",
}
} else {
code =
- ubik_Call(VL_ReleaseLock, cstruct, 0, avolid, RWVOL,
+ ubik_VL_ReleaseLock(cstruct, 0, avolid, RWVOL,
(LOCKREL_OPCODE | LOCKREL_AFSID |
LOCKREL_TIMESTAMP));
if (code) {
/* Get a clone id */
VPRINT1("Allocating new volume id for clone of volume %u ...",
avolid);
- code = ubik_Call(VL_GetNewVolumeId, cstruct, 0, 1, &acloneid);
+ code = ubik_VL_GetNewVolumeId(cstruct, 0, 1, &acloneid);
EGOTO1(bfail, code,
"Could not get an ID for the clone of volume %u from the VLDB\n",
avolid);
memset((char *)remembertime, 0, sizeof(remembertime));
memset((char *)&results, 0, sizeof(results));
- vcode = ubik_Call(VL_SetLock, cstruct, 0, afromvol, RWVOL, VLOP_RELEASE);
+ vcode = ubik_VL_SetLock(cstruct, 0, afromvol, RWVOL, VLOP_RELEASE);
if (vcode != VL_RERELEASE)
ONERROR(vcode, afromvol,
"Could not lock the VLDB entry for the volume %u.\n");
/* Make sure we have a RO volume id to work with */
if (entry.volumeId[ROVOL] == INVALID_BID) {
/* need to get a new RO volume id */
- vcode = ubik_Call(VL_GetNewVolumeId, cstruct, 0, 1, &roVolId);
+ vcode = ubik_VL_GetNewVolumeId(cstruct, 0, 1, &roVolId);
ONERROR(vcode, entry.name, "Cant allocate ID for RO volume of %s\n");
entry.volumeId[ROVOL] = roVolId;
}
if (islocked) {
vcode =
- ubik_Call(VL_ReleaseLock, cstruct, 0, afromvol, RWVOL,
+ ubik_VL_ReleaseLock(cstruct, 0, afromvol, RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (vcode) {
fprintf(STDERR,
/* Get a clone id */
VPRINT1("Allocating new volume id for clone of volume %u ...", afromvol);
- code = ubik_Call(VL_GetNewVolumeId, cstruct, 0, 1, &clonevol);
+ code = ubik_VL_GetNewVolumeId(cstruct, 0, 1, &clonevol);
EGOTO1(error_exit, code,
"Could not get an ID for the clone of volume %u from the VLDB\n",
afromvol);
if (pvolid == 0) { /*alot a new id if needed */
vcode = VLDB_GetEntryByName(tovolname, &entry);
if (vcode == VL_NOENT) {
- vcode = ubik_Call(VL_GetNewVolumeId, cstruct, 0, 1, &pvolid);
+ vcode = ubik_VL_GetNewVolumeId(cstruct, 0, 1, &pvolid);
if (vcode) {
fprintf(STDERR, "Could not get an Id for the volume %s\n",
tovolname);
fprintf(STDOUT, "------- New entry -------\n");
}
vcode =
- ubik_Call(VL_SetLock, cstruct, 0, pvolid, voltype,
+ ubik_VL_SetLock(cstruct, 0, pvolid, voltype,
VLOP_RESTORE);
if (vcode) {
fprintf(STDERR,
}
if (islocked) {
vcode =
- ubik_Call(VL_ReleaseLock, cstruct, 0, pvolid, voltype,
+ ubik_VL_ReleaseLock(cstruct, 0, pvolid, voltype,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (vcode) {
fprintf(STDERR,
VPRINT("Binding to the VLDB server\n");
vcode =
- ubik_Call(VL_ReleaseLock, cstruct, 0, volid, -1,
+ ubik_VL_ReleaseLock(cstruct, 0, volid, -1,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (vcode) {
fprintf(STDERR,
afs_int32 vcode, error = 0;
char apartName[10];
- error = ubik_Call(VL_SetLock, cstruct, 0, volid, RWVOL, VLOP_ADDSITE);
+ error = ubik_VL_SetLock(cstruct, 0, volid, RWVOL, VLOP_ADDSITE);
if (error) {
fprintf(STDERR,
" Could not lock the VLDB entry for the volume %lu \n",
asfail:
if (islocked) {
vcode =
- ubik_Call(VL_ReleaseLock, cstruct, 0, volid, RWVOL,
+ ubik_VL_ReleaseLock(cstruct, 0, volid, RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (vcode) {
fprintf(STDERR,
struct nvldbentry entry, storeEntry;
int islocked;
- vcode = ubik_Call(VL_SetLock, cstruct, 0, volid, RWVOL, VLOP_ADDSITE);
+ vcode = ubik_VL_SetLock(cstruct, 0, volid, RWVOL, VLOP_ADDSITE);
if (vcode) {
fprintf(STDERR, " Could not lock the VLDB entry for volume %lu \n",
(unsigned long)volid);
/*this site doesnot exist */
fprintf(STDERR, "This site is not a replication site \n");
vcode =
- ubik_Call(VL_ReleaseLock, cstruct, 0, volid, RWVOL,
+ ubik_VL_ReleaseLock(cstruct, 0, volid, RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (vcode) {
fprintf(STDERR, "Could not update entry for volume %lu \n",
(unsigned long)volid);
PrintError("", vcode);
- ubik_Call(VL_ReleaseLock, cstruct, 0, volid, RWVOL,
+ ubik_VL_ReleaseLock(cstruct, 0, volid, RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
return (vcode);
}
if (entry.nServers < 1) { /*this is the last ref */
VPRINT1("Deleting the VLDB entry for %u ...", volid);
fflush(STDOUT);
- vcode = ubik_Call(VL_DeleteEntry, cstruct, 0, volid, ROVOL);
+ vcode = ubik_VL_DeleteEntry(cstruct, 0, volid, ROVOL);
if (vcode) {
fprintf(STDERR,
"Could not delete VLDB entry for volume %lu \n",
"Could not release lock on volume entry for %lu \n",
(unsigned long)volid);
PrintError("", vcode);
- ubik_Call(VL_ReleaseLock, cstruct, 0, volid, RWVOL,
+ ubik_VL_ReleaseLock(cstruct, 0, volid, RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
return (vcode);
}
struct nvldbentry entry, storeEntry;
int index;
- vcode = ubik_Call(VL_SetLock, cstruct, 0, volid, RWVOL, VLOP_ADDSITE);
+ vcode = ubik_VL_SetLock(cstruct, 0, volid, RWVOL, VLOP_ADDSITE);
if (vcode) {
fprintf(STDERR, " Could not lock the VLDB entry for volume %lu \n",
(unsigned long)volid);
fprintf(STDERR, "No existing RW site for volume %lu",
(unsigned long)volid);
vcode =
- ubik_Call(VL_ReleaseLock, cstruct, 0, volid, RWVOL,
+ ubik_VL_ReleaseLock(cstruct, 0, volid, RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (vcode) {
fprintf(STDERR,
fprintf(STDERR, "Could not update entry for volume %lu \n",
(unsigned long)volid);
PrintError("", vcode);
- ubik_Call(VL_ReleaseLock, cstruct, 0, volid, RWVOL,
+ ubik_VL_ReleaseLock(cstruct, 0, volid, RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
return (vcode);
}
reuseCloneId = 1;
else { /*get a bunch of id's from vldb */
code =
- ubik_Call(VL_GetNewVolumeId, cstruct, 0, arraySize, &curCloneId);
+ ubik_VL_GetNewVolumeId(cstruct, 0, arraySize, &curCloneId);
if (code) {
fprintf(STDERR, "Could not get ID's for the clone from VLDB\n");
PrintError("", code);
* then make the changes to it (pass 2).
*/
if (++pass == 2) {
- code = ubik_Call(VL_SetLock, cstruct, 0, rwvolid, RWVOL, VLOP_DELETE);
+ code = ubik_VL_SetLock(cstruct, 0, rwvolid, RWVOL, VLOP_DELETE);
if (code) {
fprintf(STDERR, "Could not lock VLDB entry for %lu\n",
(unsigned long)rwvolid);
*modentry = modified;
} else if (pass == 2) {
code =
- ubik_Call(VL_ReleaseLock, cstruct, 0, rwvolid, RWVOL,
+ ubik_VL_ReleaseLock(cstruct, 0, rwvolid, RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (code) {
PrintError("Could not unlock VLDB entry ", code);
/* Now check if the maxvolid is larger than that stored in the VLDB */
if (maxvolid) {
afs_int32 maxvldbid = 0;
- code = ubik_Call(VL_GetNewVolumeId, cstruct, 0, 0, &maxvldbid);
+ code = ubik_VL_GetNewVolumeId(cstruct, 0, 0, &maxvldbid);
if (code) {
fprintf(STDERR,
"Could not get the highest allocated volume id from the VLDB\n");
if (!error)
error = code;
} else if (maxvolid > maxvldbid) {
- afs_uint32 id, nid;
+ afs_int32 id, nid;
id = maxvolid - maxvldbid + 1;
- code = ubik_Call(VL_GetNewVolumeId, cstruct, 0, id, &nid);
+ code = ubik_VL_GetNewVolumeId(cstruct, 0, id, &nid);
if (code) {
fprintf(STDERR,
"Error in increasing highest allocated volume id in VLDB\n");
error_exit:
/* Now check if the maxvolid is larger than that stored in the VLDB */
if (maxvolid) {
- afs_uint32 maxvldbid = 0;
- code = ubik_Call(VL_GetNewVolumeId, cstruct, 0, 0, &maxvldbid);
+ afs_int32 maxvldbid = 0;
+ code = ubik_VL_GetNewVolumeId(cstruct, 0, 0, &maxvldbid);
if (code) {
fprintf(STDERR,
"Could not get the highest allocated volume id from the VLDB\n");
if (!error)
error = code;
} else if (maxvolid > maxvldbid) {
- afs_uint32 id, nid;
+ afs_int32 id, nid;
id = maxvolid - maxvldbid + 1;
- code = ubik_Call(VL_GetNewVolumeId, cstruct, 0, id, &nid);
+ code = ubik_VL_GetNewVolumeId(cstruct, 0, id, &nid);
if (code) {
fprintf(STDERR,
"Error in increasing highest allocated volume id in VLDB\n");
*/
if (++pass == 2) {
code =
- ubik_Call(VL_SetLock, cstruct, 0, entry->volumeId[RWVOL], RWVOL,
+ ubik_VL_SetLock(cstruct, 0, entry->volumeId[RWVOL], RWVOL,
VLOP_DELETE);
if (code) {
fprintf(STDERR, "Could not lock VLDB entry for %u \n",
&& !(entry->flags & RO_EXISTS)) {
/* The RW, BK, nor RO volumes do not exist. Delete the VLDB entry */
code =
- ubik_Call(VL_DeleteEntry, cstruct, 0, entry->volumeId[RWVOL],
+ ubik_VL_DeleteEntry(cstruct, 0, entry->volumeId[RWVOL],
RWVOL);
if (code) {
fprintf(STDERR,
if (islocked) {
code =
- ubik_Call(VL_ReleaseLock, cstruct, 0, entry->volumeId[RWVOL],
+ ubik_VL_ReleaseLock(cstruct, 0, entry->volumeId[RWVOL],
RWVOL,
(LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP));
if (code) {
tid = 0;
islocked = 0;
- vcode = ubik_Call(VL_SetLock, cstruct, 0, entry->volumeId[RWVOL], RWVOL, VLOP_ADDSITE); /*last param is dummy */
+ vcode = ubik_VL_SetLock(cstruct, 0, entry->volumeId[RWVOL], RWVOL, VLOP_ADDSITE); /*last param is dummy */
if (vcode) {
fprintf(STDERR,
" Could not lock the VLDB entry for the volume %u \n",
rvfail:
if (islocked) {
vcode =
- ubik_Call(VL_ReleaseLock, cstruct, 0, entry->volumeId[RWVOL],
+ ubik_VL_ReleaseLock(cstruct, 0, entry->volumeId[RWVOL],
RWVOL,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP);
if (vcode) {