entry.nServers = 1;
entry.serverNumber[0] = ntohl(rx_HostOf(rx_PeerOf(server)));
entry.serverPartition[0] = partition;
- entry.flags = RW_EXISTS;
- entry.serverFlags[0] = ITSRWVOL;
+ entry.flags = VLF_RWEXISTS;
+ entry.serverFlags[0] = VLSF_RWVOL;
entry.volumeId[RWVOL] = *volumeId;
entry.volumeId[ROVOL] = *volumeId + 1;
entry.volumeId[BACKVOL] = *volumeId + 2;
}
if (volumeId == entry.volumeId[BACKVOL]) {
- if (!(entry.flags & BACK_EXISTS)
+ if (!(entry.flags & VLF_BACKEXISTS)
|| !Lp_Match(cellHandle, &entry, serverAddr, partition, &tst)) {
notinvldb = 2;
goto fail_UV_DeleteVolume;
}
- entry.flags &= ~BACK_EXISTS;
+ entry.flags &= ~VLF_BACKEXISTS;
vtype = BACKVOL;
}
Lp_SetROValue(cellHandle, &entry, serverAddr, partition, 0, 0);
entry.nServers--;
if (!Lp_ROMatch(cellHandle, &entry, 0, 0, &tst)) {
- entry.flags &= ~RO_EXISTS;
+ entry.flags &= ~VLF_ROEXISTS;
}
vtype = ROVOL;
}
else if (volumeId == entry.volumeId[RWVOL]) {
- if (!(entry.flags & RW_EXISTS)
+ if (!(entry.flags & VLF_RWEXISTS)
|| !Lp_Match(cellHandle, &entry, serverAddr, partition, &tst)) {
notinvldb = 2;
goto fail_UV_DeleteVolume;
Lp_SetRWValue(cellHandle, &entry, serverAddr, partition, 0L, 0L);
entry.nServers--;
- entry.flags &= ~(BACK_EXISTS | RW_EXISTS);
+ entry.flags &= ~(VLF_BACKEXISTS | VLF_RWEXISTS);
vtype = RWVOL;
}
goto fail_UV_DeleteVolume;
}
- if ((entry.nServers <= 0) || !(entry.flags & (RO_EXISTS | RW_EXISTS))) {
+ if ((entry.nServers <= 0) || !(entry.flags & (VLF_ROEXISTS | VLF_RWEXISTS))) {
tst = ubik_VL_DeleteEntry(cellHandle->vos, 0, volumeId, vtype);
if (tst) {
goto fail_UV_DeleteVolume;
Lp_SetRWValue(cellHandle, &entry, afromserver, afrompart, atoserver,
atopart);
store_flags = entry.flags;
- entry.flags &= ~BACK_EXISTS;
+ entry.flags &= ~VLF_BACKEXISTS;
if (!VLDB_ReplaceEntry
(cellHandle, afromvol, -1, &entry,
/* These operations require the VLDB be locked since it means the VLDB
* will change or the vldb is already locked.
*/
- if (!(entry.flags & BACK_EXISTS) || /* backup volume doesnt exist */
+ if (!(entry.flags & VLF_BACKEXISTS) || /* backup volume doesnt exist */
(entry.flags & VLOP_ALLOPERS) || /* vldb lock already held */
(entry.volumeId[BACKVOL] == INVALID_BID)) {
/* no assigned backup volume id */
}
/* Mork vldb as backup exists */
- if (!(entry.flags & BACK_EXISTS)) {
- entry.flags |= BACK_EXISTS;
+ if (!(entry.flags & VLF_BACKEXISTS)) {
+ entry.flags |= VLF_BACKEXISTS;
vldbmod = 1;
}
/* Will we be completing a previously unfinished release. -force overrides */
for (fullrelease = 1, i = 0; (fullrelease && (i < entry.nServers)); i++) {
- if (entry.serverFlags[i] & NEW_REPSITE)
+ if (entry.serverFlags[i] & VLSF_NEWREPSITE)
fullrelease = 0;
}
if (forceflag && !fullrelease)
* want to "reclone" a temporary RO clone.
*/
if (roexists
- && (!roclone || (entry.serverFlags[roindex] & RO_DONTUSE))) {
+ && (!roclone || (entry.serverFlags[roindex] & VLSF_DONTUSE))) {
tst = DelVol(fromconn, cloneVolId, afrompart, ITOffline);
if (tst && (tst != VNOVOL)) {
goto fail_UV_ReleaseVolume;
* RO volume is released (temp RO clones don't count).
*/
for (i = 0; i < entry.nServers; i++) {
- entry.serverFlags[i] &= ~NEW_REPSITE;
- entry.serverFlags[i] |= RO_DONTUSE;
+ entry.serverFlags[i] &= ~VLSF_NEWREPSITE;
+ entry.serverFlags[i] |= VLSF_DONTUSE;
}
- entry.serverFlags[rwindex] |= NEW_REPSITE;
- entry.serverFlags[rwindex] &= ~RO_DONTUSE;
+ entry.serverFlags[rwindex] |= VLSF_NEWREPSITE;
+ entry.serverFlags[rwindex] &= ~VLSF_DONTUSE;
/* Begin transaction on RW and mark it busy while we clone it */
tst =
sleep(5);
/* Mark the RO clone in the VLDB as a good site (already released) */
- entry.serverFlags[roindex] |= NEW_REPSITE;
- entry.serverFlags[roindex] &= ~RO_DONTUSE;
- entry.flags |= RO_EXISTS;
+ entry.serverFlags[roindex] |= VLSF_NEWREPSITE;
+ entry.serverFlags[roindex] &= ~VLSF_DONTUSE;
+ entry.flags |= VLF_ROEXISTS;
releasecount++;
if (vldbindex == roindex)
continue; /* the clone */
- if ((entry.serverFlags[vldbindex] & NEW_REPSITE)
- && !(entry.serverFlags[vldbindex] & RO_DONTUSE))
+ if ((entry.serverFlags[vldbindex] & VLSF_NEWREPSITE)
+ && !(entry.serverFlags[vldbindex] & VLSF_DONTUSE))
continue;
- if (!(entry.serverFlags[vldbindex] & ITSROVOL))
+ if (!(entry.serverFlags[vldbindex] & VLSF_ROVOL))
continue; /* not a RO vol */
continue;
}
- entry.serverFlags[times[m].vldbEntryIndex] |= NEW_REPSITE;
- entry.serverFlags[times[m].vldbEntryIndex] &= ~RO_DONTUSE;
- entry.flags |= RO_EXISTS;
+ entry.serverFlags[times[m].vldbEntryIndex] |= VLSF_NEWREPSITE;
+ entry.serverFlags[times[m].vldbEntryIndex] &= ~VLSF_DONTUSE;
+ entry.flags |= VLF_ROEXISTS;
releasecount++;
}
}
/* Figure out if any volume were not released and say so */
for (failure = 0, i = 0; i < entry.nServers; i++) {
- if (!(entry.serverFlags[i] & NEW_REPSITE))
+ if (!(entry.serverFlags[i] & VLSF_NEWREPSITE))
failure++;
}
if (failure) {
entry.cloneId = 0;
for (i = 0; i < entry.nServers; i++)
- entry.serverFlags[i] &= ~NEW_REPSITE;
+ entry.serverFlags[i] &= ~VLSF_NEWREPSITE;
/* Update the VLDB */
if (!VLDB_ReplaceEntry
entry.nServers = 1;
entry.serverNumber[0] = toserver; /*should be indirect */
entry.serverPartition[0] = topart;
- entry.serverFlags[0] = ITSRWVOL;
- entry.flags = RW_EXISTS;
+ entry.serverFlags[0] = VLSF_RWVOL;
+ entry.flags = VLF_RWEXISTS;
if (tstatus.cloneID != 0) {
entry.volumeId[ROVOL] = tstatus.cloneID; /*this should come from status info on the volume if non zero */
} else
/* Add the rw site for the volume being restored */
entry.serverNumber[entry.nServers] = toserver;
entry.serverPartition[entry.nServers] = topart;
- entry.serverFlags[entry.nServers] = ITSRWVOL;
+ entry.serverFlags[entry.nServers] = VLSF_RWVOL;
entry.nServers++;
} else {
/* This volume should be deleted on the old site
entry.serverPartition[index] = topart;
}
- entry.flags |= RW_EXISTS;
+ entry.flags |= VLF_RWEXISTS;
if (!VLDB_ReplaceEntry
(cellHandle, pvolid, RWVOL, &entry,
LOCKREL_OPCODE | LOCKREL_AFSID | LOCKREL_TIMESTAMP, &tst)) {
/* See if it's on the same server */
for (j = 0; j < entry.nServers; j++) {
- if (entry.serverFlags[j] & ITSROVOL) {
+ if (entry.serverFlags[j] & VLSF_ROVOL) {
nro++;
if (!VLDB_IsSameAddrs
(cellHandle, server, entry.serverNumber[j], &same, &tst)) {
entry.serverNumber[entry.nServers] = server;
entry.serverPartition[entry.nServers] = part;
- entry.serverFlags[entry.nServers] = (ITSROVOL | RO_DONTUSE);
+ entry.serverFlags[entry.nServers] = (VLSF_ROVOL | VLSF_DONTUSE);
entry.nServers++;
if (!VLDB_ReplaceEntry
} else { /*remove the rep site */
Lp_SetROValue(cellHandle, &entry, server, part, 0, 0);
entry.nServers--;
- if ((entry.nServers == 1) && (entry.flags & RW_EXISTS))
- entry.flags &= ~RO_EXISTS;
+ if ((entry.nServers == 1) && (entry.flags & VLF_RWEXISTS))
+ entry.flags &= ~VLF_ROEXISTS;
if (entry.nServers < 1) { /*this is the last ref */
tst = ubik_VL_DeleteEntry(cellHandle->vos, 0, volid, ROVOL);
if (tst) {
memset(&entry, 0, sizeof(entry));
strncpy(entry.name, elem.name, VOLSER_OLDMAXVOLNAME);
if (elem.isValid[RWVOL]) { /*rw exists */
- entry.flags |= RW_EXISTS;
- entry.serverFlags[entry.nServers] = ITSRWVOL;
+ entry.flags |= VLF_RWEXISTS;
+ entry.serverFlags[entry.nServers] = VLSF_RWVOL;
entry.serverNumber[entry.nServers] = aserver;
entry.serverPartition[entry.nServers] = apart;
entry.nServers += 1;
entry.volumeId[BACKVOL] = elem.ids[BACKVOL];
}
if (elem.isValid[ROVOL]) { /*ro volume exists */
- entry.flags |= RO_EXISTS;
- entry.serverFlags[entry.nServers] = ITSROVOL;
+ entry.flags |= VLF_ROEXISTS;
+ entry.serverFlags[entry.nServers] = VLSF_ROVOL;
entry.serverNumber[entry.nServers] = aserver;
entry.serverPartition[entry.nServers] = apart;
entry.nServers += 1;
}
if (elem.isValid[BACKVOL]) { /*backup volume exists */
- entry.flags |= BACK_EXISTS;
- if (!(entry.flags & RW_EXISTS)) { /*this helps to check for a stray backup if parent moves */
- entry.serverFlags[entry.nServers] = ITSRWVOL;
+ entry.flags |= VLF_BACKEXISTS;
+ if (!(entry.flags & VLF_RWEXISTS)) { /*this helps to check for a stray backup if parent moves */
+ entry.serverFlags[entry.nServers] = VLSF_RWVOL;
entry.serverNumber[entry.nServers] = aserver;
entry.serverPartition[entry.nServers] = apart;
entry.nServers += 1;
if (temp == -1) {
/* A RW index is not found in the VLDB entry - will add it */
- entry.flags |= RW_EXISTS;
+ entry.flags |= VLF_RWEXISTS;
entry.serverNumber[entry.nServers] = aserver;
entry.serverPartition[entry.nServers] = apart;
- entry.serverFlags[entry.nServers] = ITSRWVOL;
+ entry.serverFlags[entry.nServers] = VLSF_RWVOL;
entry.nServers++;
} else {
/* A RW index is found in the VLDB entry.
entry.serverPartition[temp] = apart;
}
- entry.flags |= RW_EXISTS;
+ entry.flags |= VLF_RWEXISTS;
}
if ((elem.ids[BACKVOL] != 0) && elem.isValid[BACKVOL])
entry.volumeId[BACKVOL] = elem.ids[BACKVOL];
count = entry.nServers;
rwsite = -1;
for (j = 0; j < count; j++) {
- if (entry.serverFlags[j] & ITSROVOL) {
+ if (entry.serverFlags[j] & VLSF_ROVOL) {
/*delete the site */
entry.serverNumber[j] = 0;
entry.serverPartition[j] = 0;
entry.serverFlags[j] = 0;
- } else if (entry.serverFlags[j] & ITSRWVOL)
+ } else if (entry.serverFlags[j] & VLSF_RWVOL)
rwsite = j;
}
entry.nServers = 0;
}
entry.serverNumber[entry.nServers] = aserver;
entry.serverPartition[entry.nServers] = apart;
- entry.serverFlags[entry.nServers] = ITSROVOL;
+ entry.serverFlags[entry.nServers] = VLSF_ROVOL;
entry.nServers++;
entry.volumeId[ROVOL] = elem.ids[ROVOL];
- entry.flags |= RO_EXISTS;
+ entry.flags |= VLF_ROEXISTS;
} else if (elem.ids[ROVOL] < entry.volumeId[ROVOL]) {
- if (!(entry.flags & RO_EXISTS)) {
+ if (!(entry.flags & VLF_ROEXISTS)) {
entry.volumeId[ROVOL] = elem.ids[ROVOL];
entry.serverNumber[entry.nServers] = aserver;
entry.serverPartition[entry.nServers] = apart;
- entry.serverFlags[entry.nServers] = ITSROVOL;
+ entry.serverFlags[entry.nServers] = VLSF_ROVOL;
entry.nServers++;
- entry.flags |= RO_EXISTS;
+ entry.flags |= VLF_ROEXISTS;
}
}
else if (elem.ids[ROVOL] == entry.volumeId[ROVOL]) {
entry.serverNumber[entry.nServers] = aserver;
entry.serverPartition[entry.nServers] = apart;
- entry.serverFlags[entry.nServers] = ITSROVOL;
+ entry.serverFlags[entry.nServers] = VLSF_ROVOL;
entry.nServers++;
- entry.flags |= RO_EXISTS;
+ entry.flags |= VLF_ROEXISTS;
entry.volumeId[ROVOL] = elem.ids[ROVOL];
}
}
} else {
/*tackle the backup volume */
entry.volumeId[BACKVOL] = elem.ids[BACKVOL];
- entry.flags |= BACK_EXISTS;
+ entry.flags |= VLF_BACKEXISTS;
}
if (entry.volumeId[BACKVOL] == INVALID_BID)
entry.volumeId[BACKVOL] = elem.ids[BACKVOL];
*modified = 0;
idx = Lp_GetRwIndex(cellHandle, entry, 0);
- /* Check to see if the RW volume exists and set the RW_EXISTS
+ /* Check to see if the RW volume exists and set the VLF_RWEXISTS
* flag accordingly.
*/
if (idx == -1) { /* Did not find a RW entry */
- if (entry->flags & RW_EXISTS) { /* ... yet entry says RW exists */
- entry->flags &= ~RW_EXISTS; /* ... so say RW does not exist */
+ if (entry->flags & VLF_RWEXISTS) { /* ... yet entry says RW exists */
+ entry->flags &= ~VLF_RWEXISTS; /* ... so say RW does not exist */
modentry++;
}
} else {
if (VolumeExists
(cellHandle, entry->serverNumber[idx],
entry->serverPartition[idx], entry->volumeId[RWVOL], &tst)) {
- if (!(entry->flags & RW_EXISTS)) { /* ... yet entry says RW does no
+ if (!(entry->flags & VLF_RWEXISTS)) { /* ... yet entry says RW does no
* t exist */
- entry->flags |= RW_EXISTS; /* ... so say RW does exist */
+ entry->flags |= VLF_RWEXISTS; /* ... so say RW does exist */
modentry++;
}
} else if (tst == ENODEV) { /* RW volume does not exist */
- if (entry->flags & RW_EXISTS) { /* ... yet entry says RW exists
+ if (entry->flags & VLF_RWEXISTS) { /* ... yet entry says RW exists
*/
- entry->flags &= ~RW_EXISTS; /* ... so say RW does not exist
+ entry->flags &= ~VLF_RWEXISTS; /* ... so say RW does not exist
*/
modentry++;
}
} else {
/* If VLDB says it didn't exist, then ignore error */
- if (entry->flags & RW_EXISTS) {
+ if (entry->flags & VLF_RWEXISTS) {
goto fail_CheckVldbRWBK;
}
}
}
- /* Check to see if the BK volume exists and set the BACK_EXISTS
+ /* Check to see if the BK volume exists and set the VLF_BACKEXISTS
* flag accordingly. idx already ponts to the RW entry.
*/
if (idx == -1) { /* Did not find a RW entry */
- if (entry->flags & BACK_EXISTS) { /* ... yet entry says BK exists */
- entry->flags &= ~BACK_EXISTS; /* ... so say BK does not exist */
+ if (entry->flags & VLF_BACKEXISTS) { /* ... yet entry says BK exists */
+ entry->flags &= ~VLF_BACKEXISTS; /* ... so say BK does not exist */
modentry++;
}
} else { /* Found a RW entry */
if (VolumeExists
(cellHandle, entry->serverNumber[idx],
entry->serverPartition[idx], entry->volumeId[BACKVOL], &tst)) {
- if (!(entry->flags & BACK_EXISTS)) { /* ... yet entry says BK does n
+ if (!(entry->flags & VLF_BACKEXISTS)) { /* ... yet entry says BK does n
* ot exist */
- entry->flags |= BACK_EXISTS; /* ... so say BK does exist */
+ entry->flags |= VLF_BACKEXISTS; /* ... so say BK does exist */
modentry++;
}
} else if (tst == ENODEV) { /* BK volume does not exist */
- if (entry->flags & BACK_EXISTS) { /* ... yet entry says BK exists
+ if (entry->flags & VLF_BACKEXISTS) { /* ... yet entry says BK exists
*/
- entry->flags &= ~BACK_EXISTS; /* ... so say BK does not exist
+ entry->flags &= ~VLF_BACKEXISTS; /* ... so say BK does not exist
*/
modentry++;
}
} else {
/* If VLDB says it didn't exist, then ignore error */
- if (entry->flags & BACK_EXISTS) {
+ if (entry->flags & VLF_BACKEXISTS) {
goto fail_CheckVldbRWBK;
}
}
/* If there is an idx but the BK and RW volumes no
* longer exist, then remove the RW entry.
*/
- if ((idx != -1) && !(entry->flags & RW_EXISTS)
- && !(entry->flags & BACK_EXISTS)) {
+ if ((idx != -1) && !(entry->flags & VLF_RWEXISTS)
+ && !(entry->flags & VLF_BACKEXISTS)) {
Lp_SetRWValue(cellHandle, entry, entry->serverNumber[idx],
entry->serverPartition[idx], 0L, 0L);
entry->nServers--;
if (modified)
*modified = 0;
- /* Check to see if the RO volumes exist and set the RO_EXISTS
+ /* Check to see if the RO volumes exist and set the VLF_ROEXISTS
* flag accordingly.
*/
for (idx = 0; idx < entry->nServers; idx++) {
- if (!(entry->serverFlags[idx] & ITSROVOL)) {
+ if (!(entry->serverFlags[idx] & VLSF_ROVOL)) {
continue; /* not a RO */
}
}
if (foundro) { /* A RO volume exists */
- if (!(entry->flags & RO_EXISTS)) { /* ... yet entry says RW does not e
+ if (!(entry->flags & VLF_ROEXISTS)) { /* ... yet entry says RW does not e
* xist */
- entry->flags |= RO_EXISTS; /* ... so say RW does exist */
+ entry->flags |= VLF_ROEXISTS; /* ... so say RW does exist */
modentry++;
}
} else { /* A RO volume does not exist */
- if (entry->flags & RO_EXISTS) { /* ... yet entry says RO exists */
- entry->flags &= ~RO_EXISTS; /* ... so say RO does not exist */
+ if (entry->flags & VLF_ROEXISTS) { /* ... yet entry says RO exists */
+ entry->flags &= ~VLF_ROEXISTS; /* ... so say RO does not exist */
modentry++;
}
}
if (pass == 1)
goto retry;
- if (!(entry->flags & RW_EXISTS) && !(entry->flags & BACK_EXISTS)
- && !(entry->flags & RO_EXISTS)) {
+ if (!(entry->flags & VLF_RWEXISTS) && !(entry->flags & VLF_BACKEXISTS)
+ && !(entry->flags & VLF_ROEXISTS)) {
/* The RW, BK, nor RO volumes do not exist. Delete the VLDB entry */
tst =
ubik_VL_DeleteEntry(cellHandle->vos, 0,
/*at this stage the intent to rename is recorded in the vldb, as far
* as the vldb
* is concerned, oldname is lost */
- if (entry->flags & RW_EXISTS) {
+ if (entry->flags & VLF_RWEXISTS) {
index = Lp_GetRwIndex(cellHandle, entry, 0);
if (index == -1) { /* there is a serious discrepancy */
tst = VOLSERVLDB_ERROR;
aconn = (struct rx_connection *)0;
}
/*end rw volume processing */
- if (entry->flags & BACK_EXISTS) { /*process the backup volume */
+ if (entry->flags & VLF_BACKEXISTS) { /*process the backup volume */
index = Lp_GetRwIndex(cellHandle, entry, 0);
if (index == -1) { /* there is a serious discrepancy */
tst = VOLSERVLDB_ERROR;
if (aconn)
rx_ReleaseCachedConnection(aconn);
aconn = (struct rx_connection *)0;
- if (entry->flags & RO_EXISTS) { /*process the ro volumes */
+ if (entry->flags & VLF_ROEXISTS) { /*process the ro volumes */
for (i = 0; i < entry->nServers; i++) {
- if (entry->serverFlags[i] & ITSROVOL) {
+ if (entry->serverFlags[i] & VLSF_ROVOL) {
aconn =
UV_Bind(cellHandle, entry->serverNumber[i],
AFSCONF_VOLUMEPORT);