#ifdef notdef
fprintf(STDOUT, " readWriteID %-10u ", entry->volumeId[RWVOL]);
- if (entry->flags & RW_EXISTS)
+ if (entry->flags & VLF_RWEXISTS)
fprintf(STDOUT, " valid \n");
else
fprintf(STDOUT, " invalid \n");
fprintf(STDOUT, " readOnlyID %-10u ", entry->volumeId[ROVOL]);
- if (entry->flags & RO_EXISTS)
+ if (entry->flags & VLF_ROEXISTS)
fprintf(STDOUT, " valid \n");
else
fprintf(STDOUT, " invalid \n");
fprintf(STDOUT, " backUpID %-10u ", entry->volumeId[BACKVOL]);
- if (entry->flags & BACK_EXISTS)
+ if (entry->flags & VLF_BACKEXISTS)
fprintf(STDOUT, " valid \n");
else
fprintf(STDOUT, " invalid \n");
- if ((entry->cloneId != 0) && (entry->flags & RO_EXISTS))
+ if ((entry->cloneId != 0) && (entry->flags & VLF_ROEXISTS))
fprintf(STDOUT, " releaseClone %-10u \n", entry->cloneId);
#else
- if (entry->flags & RW_EXISTS)
+ if (entry->flags & VLF_RWEXISTS)
fprintf(STDOUT, " RWrite: %-10u", entry->volumeId[RWVOL]);
- if (entry->flags & RO_EXISTS)
+ if (entry->flags & VLF_ROEXISTS)
fprintf(STDOUT, " ROnly: %-10u", entry->volumeId[ROVOL]);
- if (entry->flags & BACK_EXISTS)
+ if (entry->flags & VLF_BACKEXISTS)
fprintf(STDOUT, " Backup: %-10u", entry->volumeId[BACKVOL]);
- if ((entry->cloneId != 0) && (entry->flags & RO_EXISTS))
+ if ((entry->cloneId != 0) && (entry->flags & VLF_ROEXISTS))
fprintf(STDOUT, " RClone: %-10lu", (unsigned long)entry->cloneId);
fprintf(STDOUT, "\n");
#endif
fprintf(STDOUT, " number of sites -> %lu\n",
(unsigned long)entry->nServers);
for (i = 0; i < entry->nServers; i++) {
- if (entry->serverFlags[i] & NEW_REPSITE)
+ if (entry->serverFlags[i] & VLSF_NEWREPSITE)
isMixed = 1;
}
for (i = 0; i < entry->nServers; i++) {
fprintf(STDOUT, " server %s partition %s ",
noresolve ? afs_inet_ntoa_r(entry->serverNumber[i], hoststr) :
hostutil_GetNameByINet(entry->serverNumber[i]), pname);
- if (entry->serverFlags[i] & ITSRWVOL)
+ if (entry->serverFlags[i] & VLSF_RWVOL)
fprintf(STDOUT, "RW Site ");
else
fprintf(STDOUT, "RO Site ");
if (isMixed) {
- if (entry->serverFlags[i] & NEW_REPSITE)
+ if (entry->serverFlags[i] & VLSF_NEWREPSITE)
fprintf(STDOUT," -- New release");
else
- if (!(entry->serverFlags[i] & ITSRWVOL))
+ if (!(entry->serverFlags[i] & VLSF_RWVOL))
fprintf(STDOUT," -- Old release");
} else {
- if (entry->serverFlags[i] & RO_DONTUSE)
+ if (entry->serverFlags[i] & VLSF_DONTUSE)
fprintf(STDOUT, " -- Not released");
}
fprintf(STDOUT, "\n");
* level of indirection later */
entry.serverPartition[0] = apart; /* this should also have
* another indirection level */
- entry.flags = RW_EXISTS; /* this records that rw volume exists */
- entry.serverFlags[0] = ITSRWVOL; /*this rep site has rw vol */
+ entry.flags = VLF_RWEXISTS; /* this records that rw volume exists */
+ entry.serverFlags[0] = VLSF_RWVOL; /*this rep site has rw vol */
entry.volumeId[RWVOL] = *anewid;
entry.volumeId[ROVOL] = aroid ? *aroid : 0;
entry.volumeId[BACKVOL] = abkid ? *abkid : 0;
* level of indirection later */
entry.serverPartition[0] = apart; /* this should also have
* another indirection level */
- entry.flags = RW_EXISTS; /* this records that rw volume exists */
- entry.serverFlags[0] = ITSRWVOL; /*this rep site has rw vol */
+ entry.flags = VLF_RWEXISTS; /* this records that rw volume exists */
+ entry.serverFlags[0] = VLSF_RWVOL; /*this rep site has rw vol */
entry.volumeId[RWVOL] = aid;
#ifdef notdef
entry.volumeId[ROVOL] = anewid + 1; /* rw,ro, bk id are related in the default case */
/* Its a backup volume, modify the VLDB entry. Check that the
* backup volume is on the server/partition we asked to delete.
*/
- if (!(entry.flags & BACK_EXISTS) || !Lp_Match(aserver, apart, &entry)) {
+ if (!(entry.flags & VLF_BACKEXISTS) || !Lp_Match(aserver, apart, &entry)) {
notinvldb = 2; /* Not on this server and partition */
ERROR_EXIT(0);
}
VPRINT1("Marking the backup volume %u deleted in the VLDB\n", avolid);
- entry.flags &= ~BACK_EXISTS;
+ entry.flags &= ~VLF_BACKEXISTS;
vtype = BACKVOL;
}
Lp_SetROValue(&entry, aserver, apart, 0, 0); /* delete the site */
entry.nServers--;
if (!Lp_ROMatch(0, 0, &entry))
- entry.flags &= ~RO_EXISTS; /* This was the last ro volume */
+ entry.flags &= ~VLF_ROEXISTS; /* This was the last ro volume */
vtype = ROVOL;
}
* Check that the readwrite volumes is on the server/partition we
* asked to delete.
*/
- if (!(entry.flags & RW_EXISTS) || !Lp_Match(aserver, apart, &entry)) {
+ if (!(entry.flags & VLF_RWEXISTS) || !Lp_Match(aserver, apart, &entry)) {
notinvldb = 2; /* Not found on this server and partition */
ERROR_EXIT(0);
}
"Marking the readwrite volume %lu%s deleted in the VLDB\n",
(unsigned long)avolid,
((entry.
- flags & BACK_EXISTS) ? ", and its backup volume," :
+ flags & VLF_BACKEXISTS) ? ", and its backup volume," :
""));
Lp_SetRWValue(&entry, aserver, apart, 0L, 0L);
entry.nServers--;
- entry.flags &= ~(BACK_EXISTS | RW_EXISTS);
+ entry.flags &= ~(VLF_BACKEXISTS | VLF_RWEXISTS);
vtype = RWVOL;
- if (entry.flags & RO_EXISTS)
+ if (entry.flags & VLF_ROEXISTS)
fprintf(STDERR, "WARNING: ReadOnly copy(s) may still exist\n");
}
}
/* Either delete or replace the VLDB entry */
- if ((entry.nServers <= 0) || !(entry.flags & (RO_EXISTS | RW_EXISTS))) {
+ if ((entry.nServers <= 0) || !(entry.flags & (VLF_ROEXISTS | VLF_RWEXISTS))) {
if (verbose)
fprintf(STDOUT,
"Last reference to the VLDB entry for %lu - deleting entry\n",
/* extract information from the original entry */
for (i = 0; i < entry->nServers; i++) {
- if (entry->serverFlags[i] & ITSRWVOL) {
+ if (entry->serverFlags[i] & VLSF_RWVOL) {
rwindex = i;
rwserver = entry->serverNumber[i];
/* rwpartition = entry->serverPartition[i]; */
if (roserver)
break;
- } else if ((entry->serverFlags[i] & ITSROVOL) && !roserver) {
+ } else if ((entry->serverFlags[i] & VLSF_ROVOL) && !roserver) {
same = VLDB_IsSameAddrs(server, entry->serverNumber[i], &code);
if (code) {
fprintf(STDERR,
/* Update the VLDB to match what we did on disk as much as possible. */
/* If the converted RO was in the VLDB, make it look like the new RW. */
if (roserver) {
- entry->serverFlags[roindex] = ITSRWVOL;
+ entry->serverFlags[roindex] = VLSF_RWVOL;
} else {
/* Add a new site entry for the newly created RW. It's possible
* (but unlikely) that we are already at MAXNSERVERS and that this
(entry->nServers)++;
entry->serverNumber[newrwindex] = server;
entry->serverPartition[newrwindex] = partition;
- entry->serverFlags[newrwindex] = ITSRWVOL;
+ entry->serverFlags[newrwindex] = VLSF_RWVOL;
}
- entry->flags |= RW_EXISTS;
- entry->flags &= ~BACK_EXISTS;
+ entry->flags |= VLF_RWEXISTS;
+ entry->flags &= ~VLF_BACKEXISTS;
/* if the old RW was in the VLDB, remove it by decrementing the number */
/* of servers, replacing the RW entry with the last entry, and zeroing */
entry->serverFlags[entry->nServers] = 0;
}
}
- entry->flags &= ~RO_EXISTS;
+ entry->flags &= ~VLF_ROEXISTS;
for (i = 0; i < entry->nServers; i++) {
- if (entry->serverFlags[i] & ITSROVOL) {
- if (!(entry->serverFlags[i] & (RO_DONTUSE | NEW_REPSITE)))
- entry->flags |= RO_EXISTS;
+ if (entry->serverFlags[i] & VLSF_ROVOL) {
+ if (!(entry->serverFlags[i] & (VLSF_DONTUSE | VLSF_NEWREPSITE)))
+ entry->flags |= VLF_ROEXISTS;
}
}
MapNetworkToHost(entry, &storeEntry);
(unsigned long)afromvol);
fprintf(STDERR, "The current site is :");
for (i = 0; i < entry.nServers; i++) {
- if (entry.serverFlags[i] == ITSRWVOL) {
+ if (entry.serverFlags[i] == VLSF_RWVOL) {
char pname[10];
MapPartIdIntoName(entry.serverPartition[i], pname);
fprintf(STDERR, " server %s partition %s \n",
Lp_SetRWValue(&entry, afromserver, afrompart, atoserver, atopart);
MapNetworkToHost(&entry, &storeEntry);
- storeEntry.flags &= ~BACK_EXISTS;
+ storeEntry.flags &= ~VLF_BACKEXISTS;
if (TESTC) {
fprintf(STDOUT,
/* normal cleanup code */
- if (entry.flags & RO_EXISTS)
+ if (entry.flags & VLF_ROEXISTS)
fprintf(STDERR, "WARNING : readOnly copies still exist \n");
if (islocked) {
newentry.nServers = 1;
newentry.serverNumber[0] = atoserver;
newentry.serverPartition[0] = atopart;
- newentry.flags = (flags & RV_RDONLY) ? RO_EXISTS : RW_EXISTS;
- newentry.serverFlags[0] = (flags & RV_RDONLY) ? ITSROVOL : ITSRWVOL;
+ newentry.flags = (flags & RV_RDONLY) ? VLF_ROEXISTS : VLF_RWEXISTS;
+ newentry.serverFlags[0] = (flags & RV_RDONLY) ? VLSF_ROVOL : VLSF_RWVOL;
newentry.volumeId[RWVOL] = newVol;
newentry.volumeId[ROVOL] = (flags & RV_RDONLY) ? newVol : 0;
newentry.volumeId[BACKVOL] = 0;
/* 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 */
}
/* Mark vldb as backup exists */
- if (!(entry.flags & BACK_EXISTS)) {
- entry.flags |= BACK_EXISTS;
+ if (!(entry.flags & VLF_BACKEXISTS)) {
+ entry.flags |= VLF_BACKEXISTS;
vldbmod = 1;
}
vldbEntryPtr->serverPartition[index], ITOffline,
transPtr);
- if (!code && (origflags[index] & RO_DONTUSE)) {
+ if (!code && (origflags[index] & VLSF_DONTUSE)) {
/* If RO_DONTUSE is set, this is supposed to be an entirely new
* site. Don't trust any data on it, since it is possible we
* have encountered some temporary volume from some other
* or -force-reclone flag, to force this to be a complete release.
*/
for (i = 0; i < entry.nServers; i++) {
- if (entry.serverFlags[i] & ITSROVOL) {
+ if (entry.serverFlags[i] & VLSF_ROVOL) {
sites++;
- if (entry.serverFlags[i] & NEW_REPSITE)
+ if (entry.serverFlags[i] & VLSF_NEWREPSITE)
new_sites++;
- if (entry.serverFlags[i] & RO_DONTUSE)
+ if (entry.serverFlags[i] & VLSF_DONTUSE)
notreleased++;
}
origflags[i] = entry.serverFlags[i];
error = 0;
for (e = 0; (e < entry.nServers) && !error; e++) {
- if ((entry.serverFlags[e] & ITSROVOL)) {
+ if ((entry.serverFlags[e] & VLSF_ROVOL)) {
if (!(VLDB_IsSameAddrs(entry.serverNumber[e], afromserver,
&error)))
break;
}
/* clean up any previous tmp clone before starting if staying up */
if (roexists
- && (!roclone || (entry.serverFlags[roindex] & RO_DONTUSE))) {
+ && (!roclone || (entry.serverFlags[roindex] & VLSF_DONTUSE))) {
code = DoVolDelete(fromconn,
stayUp ? entry.volumeId[ROVOL] : cloneVolId,
afrompart, "the", 0, NULL, NULL);
struct rx_connection *conn;
afs_int32 crdate;
- if (!(entry.serverFlags[vldbindex] & ITSROVOL)) {
+ if (!(entry.serverFlags[vldbindex] & VLSF_ROVOL)) {
continue;
}
- if ((entry.serverFlags[vldbindex] & RO_DONTUSE)) {
+ if ((entry.serverFlags[vldbindex] & VLSF_DONTUSE)) {
continue;
}
conn = UV_Bind(entry.serverNumber[vldbindex], AFSCONF_VOLUMEPORT);
*/
for (i = 0; i < entry.nServers; i++) {
if (justnewsites) {
- if ((entry.serverFlags[i] & RO_DONTUSE)) {
- entry.serverFlags[i] &= ~NEW_REPSITE;
+ if ((entry.serverFlags[i] & VLSF_DONTUSE)) {
+ entry.serverFlags[i] &= ~VLSF_NEWREPSITE;
} else {
- entry.serverFlags[i] |= NEW_REPSITE;
+ entry.serverFlags[i] |= VLSF_NEWREPSITE;
}
} else {
- 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;
}
if (justnewsites && roexists) {
justnewsites = 0;
/* reset the serverFlags as if 'justnewsites' had never been set */
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;
}
rwcrdate = volstatus.creationDate;
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 we have a clone, treat this as done, for now */
if (stayUp && !complete_release) {
- 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++;
}
}
}
if (code) {
EPRINT(code, "Failed: ");
- entry.serverFlags[roindex] &= ~NEW_REPSITE;
- entry.serverFlags[roindex] |= RO_DONTUSE;
+ entry.serverFlags[roindex] &= ~VLSF_NEWREPSITE;
+ entry.serverFlags[roindex] |= VLSF_DONTUSE;
} else {
- 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;
VDONE;
}
if (code) {
if (!times[s].crtime) {
- entry.serverFlags[vldbindex] |= RO_DONTUSE;
+ entry.serverFlags[vldbindex] |= VLSF_DONTUSE;
}
- entry.serverFlags[vldbindex] &= ~NEW_REPSITE;
+ entry.serverFlags[vldbindex] &= ~VLSF_NEWREPSITE;
PrintError("Failed: ",
code);
} else
VDONE;
- if (entry.serverFlags[vldbindex] != RO_DONTUSE) {
+ if (entry.serverFlags[vldbindex] != VLSF_DONTUSE) {
/* bring it online (mark it InService) */
VPRINT1("Bringing readonly online on %s...",
noresolve ?
/* needed to come online for cloning */
if (code) {
/* technically it's still new, just not online */
- entry.serverFlags[s] &= ~NEW_REPSITE;
- entry.serverFlags[s] |= RO_DONTUSE;
+ entry.serverFlags[s] &= ~VLSF_NEWREPSITE;
+ entry.serverFlags[s] |= VLSF_DONTUSE;
if (code != ENOENT) {
PrintError("Failed to set correct names and ids: ",
code);
/* 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) {
"The volume %lu could not be released to the following %d sites:\n",
(unsigned long)afromvol, failure);
for (i = 0; i < entry.nServers; i++) {
- if (!(entry.serverFlags[i] & NEW_REPSITE)) {
+ if (!(entry.serverFlags[i] & VLSF_NEWREPSITE)) {
MapPartIdIntoName(entry.serverPartition[i], pname);
fprintf(STDERR, "\t%35s %s\n",
noresolve ? afs_inet_ntoa_r(entry.serverNumber[i], hoststr) :
}
for (i = 0; i < entry.nServers; i++)
- entry.serverFlags[i] &= ~NEW_REPSITE;
+ entry.serverFlags[i] &= ~VLSF_NEWREPSITE;
/* Update the VLDB */
VPRINT("updating VLDB ...");
}
reuseID = 0;
} else if (flags & RV_RDONLY) {
- if (entry.flags & RW_EXISTS) {
+ if (entry.flags & VLF_RWEXISTS) {
fprintf(STDERR,
"Entry for ReadWrite volume %s already exists!\n",
entry.name);
entry.nServers = 1;
entry.serverNumber[0] = toserver; /*should be indirect */
entry.serverPartition[0] = topart;
- entry.serverFlags[0] = (flags & RV_RDONLY) ? ITSROVOL : ITSRWVOL;
- entry.flags = (flags & RV_RDONLY) ? RO_EXISTS : RW_EXISTS;
+ entry.serverFlags[0] = (flags & RV_RDONLY) ? VLSF_ROVOL : VLSF_RWVOL;
+ entry.flags = (flags & RV_RDONLY) ? VLF_ROEXISTS : VLF_RWEXISTS;
if (flags & RV_RDONLY)
entry.volumeId[ROVOL] = pvolid;
else if (tstatus.cloneID != 0) {
entry.serverNumber[entry.nServers] = toserver;
entry.serverPartition[entry.nServers] = topart;
entry.serverFlags[entry.nServers] =
- (flags & RV_RDONLY) ? ITSROVOL : ITSRWVOL;
+ (flags & RV_RDONLY) ? VLSF_ROVOL : VLSF_RWVOL;
entry.nServers++;
} else {
/* This volume should be deleted on the old site
entry.serverPartition[index] = topart;
}
- entry.flags |= (flags & RV_RDONLY) ? RO_EXISTS : RW_EXISTS;
+ entry.flags |= (flags & RV_RDONLY) ? VLF_ROEXISTS : VLF_RWEXISTS;
MapNetworkToHost(&entry, &storeEntry);
vcode =
VLDB_ReplaceEntry(pvolid, voltype, &storeEntry,
/* 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(server, entry.serverNumber[j], &error)) {
if (error) {
entry.serverNumber[entry.nServers] = server;
entry.serverPartition[entry.nServers] = part;
if (!valid) {
- entry.serverFlags[entry.nServers] = (ITSROVOL | RO_DONTUSE);
+ entry.serverFlags[entry.nServers] = (VLSF_ROVOL | VLSF_DONTUSE);
} else {
- entry.serverFlags[entry.nServers] = (ITSROVOL);
+ entry.serverFlags[entry.nServers] = (VLSF_ROVOL);
}
entry.nServers++;
} else { /*remove the rep site */
Lp_SetROValue(&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 */
VPRINT1("Deleting the VLDB entry for %u ...", volid);
fflush(STDOUT);
if (createentry) {
fprintf(STDOUT, "\n**does not exist**\n");
} else {
- if ((entry.flags & RW_EXISTS) || (entry.flags & RO_EXISTS)
- || (entry.flags & BACK_EXISTS))
+ if ((entry.flags & VLF_RWEXISTS) || (entry.flags & VLF_ROEXISTS)
+ || (entry.flags & VLF_BACKEXISTS))
EnumerateEntry(&entry);
}
fprintf(STDOUT, "\n");
} else { /* RW index found in the VLDB entry. */
/* Verify if this volume's location matches where the VLDB says it is */
if (!Lp_Match(aserver, apart, &entry)) {
- if (entry.flags & RW_EXISTS) {
+ if (entry.flags & VLF_RWEXISTS) {
/* The RW volume exists elsewhere - report this one a duplicate */
if (pass == 1) {
MapPartIdIntoName(apart, pname);
addvolume++;
/* Check for orphaned BK volume on old partition */
- if (entry.flags & BACK_EXISTS) {
+ if (entry.flags & VLF_BACKEXISTS) {
if (pass == 1) {
MapPartIdIntoName(entry.serverPartition[idx],
pname);
}
if (addvolume) {
- entry.flags |= RW_EXISTS;
+ entry.flags |= VLF_RWEXISTS;
entry.volumeId[RWVOL] = rwvolid;
if (!entry.volumeId[BACKVOL])
entry.volumeId[BACKVOL] = volumeinfo->backupID;
if (!entry.volumeId[ROVOL])
entry.volumeId[ROVOL] = volumeinfo->cloneID;
- entry.serverFlags[idx] = ITSRWVOL;
+ entry.serverFlags[idx] = VLSF_RWVOL;
entry.serverNumber[idx] = aserver;
entry.serverPartition[idx] = apart;
strncpy(entry.name, volumeinfo->name, VOLSER_OLDMAXVOLNAME);
}
} else {
if (volumeinfo->volid != entry.volumeId[BACKVOL]) {
- if (!(entry.flags & BACK_EXISTS)) {
+ if (!(entry.flags & VLF_BACKEXISTS)) {
addvolume++;
} else if (volumeinfo->volid >
entry.volumeId[BACKVOL]) {
}
}
if (addvolume) {
- entry.flags |= BACK_EXISTS;
+ entry.flags |= VLF_BACKEXISTS;
entry.volumeId[RWVOL] = rwvolid;
entry.volumeId[BACKVOL] = volumeinfo->volid;
entry.serverNumber[idx] = aserver;
entry.serverPartition[idx] = apart;
- entry.serverFlags[idx] = ITSRWVOL;
+ entry.serverFlags[idx] = VLSF_RWVOL;
modified++;
}
entry.nServers++;
addvolume++;
} else {
- if (!(entry.flags & RO_EXISTS)) {
+ if (!(entry.flags & VLF_ROEXISTS)) {
addvolume++;
}
}
if (mod)
modified++;
- if (!(entry.flags & RO_EXISTS)) {
+ if (!(entry.flags & VLF_ROEXISTS)) {
/* No RO exists in the VLDB entry - add this one */
idx = entry.nServers;
entry.nServers++;
* all the RO volumes listed in VLDB entry and add this volume.
*/
for (j = 0; j < entry.nServers; j++) {
- if (entry.serverFlags[j] & ITSROVOL) {
+ if (entry.serverFlags[j] & VLSF_ROVOL) {
/* Verify this volume exists and print message we are orphaning it */
if (pass == 1) {
MapPartIdIntoName(apart, pname);
}
if (addvolume) {
- entry.flags |= RO_EXISTS;
+ entry.flags |= VLF_ROEXISTS;
entry.volumeId[RWVOL] = rwvolid;
entry.volumeId[ROVOL] = volumeinfo->volid;
entry.serverNumber[idx] = aserver;
entry.serverPartition[idx] = apart;
- entry.serverFlags[idx] = ITSROVOL;
+ entry.serverFlags[idx] = VLSF_ROVOL;
modified++;
}
if (vcode) {
fprintf(STDOUT, "\n**does not exist**\n");
} else {
- if ((vldbentry.flags & RW_EXISTS) || (vldbentry.flags & RO_EXISTS)
- || (vldbentry.flags & BACK_EXISTS))
+ if ((vldbentry.flags & VLF_RWEXISTS) || (vldbentry.flags & VLF_ROEXISTS)
+ || (vldbentry.flags & VLF_BACKEXISTS))
EnumerateEntry(&vldbentry);
}
fprintf(STDOUT, "\n");
*modified = 0;
idx = Lp_GetRwIndex(entry);
- /* 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 {
VolumeExists(entry->serverNumber[idx],
entry->serverPartition[idx], entry->volumeId[RWVOL]);
if (code == 0) { /* RW volume exists */
- if (!(entry->flags & RW_EXISTS)) { /* ... yet entry says RW does not exist */
- entry->flags |= RW_EXISTS; /* ... so say RW does exist */
+ if (!(entry->flags & VLF_RWEXISTS)) { /* ... yet entry says RW does not exist */
+ entry->flags |= VLF_RWEXISTS; /* ... so say RW does exist */
modentry++;
}
} else if (code == ENODEV) { /* RW volume does not exist */
- 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 VLDB says it didn't exist, then ignore error */
- if (entry->flags & RW_EXISTS) {
+ if (entry->flags & VLF_RWEXISTS) {
MapPartIdIntoName(entry->serverPartition[idx], pname);
fprintf(STDERR,
"Transaction call failed for RW volume %u on server %s %s\n",
}
}
- /* 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 */
entry->serverPartition[idx],
entry->volumeId[BACKVOL]);
if (code == 0) { /* BK volume exists */
- if (!(entry->flags & BACK_EXISTS)) { /* ... yet entry says BK does not exist */
- entry->flags |= BACK_EXISTS; /* ... so say BK does exist */
+ if (!(entry->flags & VLF_BACKEXISTS)) { /* ... yet entry says BK does not exist */
+ entry->flags |= VLF_BACKEXISTS; /* ... so say BK does exist */
modentry++;
}
} else if (code == ENODEV) { /* BK volume does not exist */
- 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 {
/* If VLDB says it didn't exist, then ignore error */
- if (entry->flags & BACK_EXISTS) {
+ if (entry->flags & VLF_BACKEXISTS) {
MapPartIdIntoName(entry->serverPartition[idx], pname);
fprintf(STDERR,
"Transaction call failed for BK volume %u on server %s %s\n",
/* 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(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 exist */
- entry->flags |= RO_EXISTS; /* ... so say RW does exist */
+ if (!(entry->flags & VLF_ROEXISTS)) { /* ... yet entry says RW does not 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 (verbose) {
fprintf(STDOUT, "_______________________________\n");
fprintf(STDOUT, "\n-- status before -- \n");
- if ((entry->flags & RW_EXISTS) || (entry->flags & RO_EXISTS)
- || (entry->flags & BACK_EXISTS))
+ if ((entry->flags & VLF_RWEXISTS) || (entry->flags & VLF_ROEXISTS)
+ || (entry->flags & VLF_BACKEXISTS))
EnumerateEntry(entry);
fprintf(STDOUT, "\n");
}
if (pass == 1)
goto retry;
- if (!(entry->flags & RW_EXISTS) && !(entry->flags & BACK_EXISTS)
- && !(entry->flags & RO_EXISTS) && doit) {
+ if (!(entry->flags & VLF_RWEXISTS) && !(entry->flags & VLF_BACKEXISTS)
+ && !(entry->flags & VLF_ROEXISTS) && doit) {
/* The RW, BK, nor RO volumes do not exist. Delete the VLDB entry */
code =
ubik_VL_DeleteEntry(cstruct, 0, entry->volumeId[RWVOL],
VPRINT1("Recorded the new name %s in VLDB\n", newname);
/*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(entry);
if (index == -1) { /* there is a serious discrepancy */
fprintf(STDERR,
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(entry);
if (index == -1) { /* there is a serious discrepancy */
fprintf(STDERR,
if (aconn)
rx_DestroyConnection(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(entry->serverNumber[i], AFSCONF_VOLUMEPORT);
code =
AFSVolTransCreate_retry(aconn, entry->volumeId[ROVOL],