{
afs_int32 code;
+ DBHOLD(adbase);
code = ReplayLog(adbase);
if (code)
- return code;
+ goto done;
code = InitializeDB(adbase);
+done:
+ DBRELE(adbase);
return code;
}
*/
if ((now = FT_ApproxTime()) > 30 + lastProbeTime) {
-#ifdef AFS_PTHREAD_ENV
- DBHOLD(ubik_dbase);
-#endif
-
for (ts = ubik_servers, doingRPC = 0; ts; ts = ts->next) {
UBIK_BEACON_LOCK;
if (!ts->up) {
if (code == 0) {
UBIK_BEACON_LOCK;
ts->up = 1;
+ UBIK_BEACON_UNLOCK;
+ DBHOLD(ubik_dbase);
urecovery_state &= ~UBIK_RECFOUNDDB;
+ DBRELE(ubik_dbase);
}
- } else if (!ts->currentDB) {
- urecovery_state &= ~UBIK_RECFOUNDDB;
+ } else {
+ UBIK_BEACON_UNLOCK;
+ DBHOLD(ubik_dbase);
+ if (!ts->currentDB)
+ urecovery_state &= ~UBIK_RECFOUNDDB;
+ DBRELE(ubik_dbase);
}
- UBIK_BEACON_UNLOCK;
}
-#ifdef AFS_PTHREAD_ENV
- DBRELE(ubik_dbase);
-#endif
-
if (doingRPC)
now = FT_ApproxTime();
lastProbeTime = now;
}
/* Mark whether we are the sync site */
+ DBHOLD(ubik_dbase);
if (!ubeacon_AmSyncSite()) {
urecovery_state &= ~UBIK_RECSYNCSITE;
DBRELE(ubik_dbase);
* most current database, then go find the most current db.
*/
if (!(urecovery_state & UBIK_RECFOUNDDB)) {
+ DBRELE(ubik_dbase);
bestServer = (struct ubik_server *)0;
bestDBVersion.epoch = 0;
bestDBVersion.counter = 0;
* the sync site, have the best version. Also note that
* we may need to send the best version out.
*/
+ DBHOLD(ubik_dbase);
if (vcmp(ubik_dbase->version, bestDBVersion) >= 0) {
bestDBVersion = ubik_dbase->version;
bestServer = (struct ubik_server *)0;
#else
LWP_NoYieldSignal(&ubik_dbase->version);
#endif
- DBRELE(ubik_dbase);
}
if (!(urecovery_state & UBIK_RECHAVEDB)) {
DBRELE(ubik_dbase);
UBIK_ADDR_UNLOCK;
osi_Assert(i); /* at least one interface address for this server */
-#ifdef AFS_PTHREAD_ENV
- DBRELE(ubik_dbase);
-#endif
-
multi_Rx(conns, i) {
multi_DISK_Probe();
if (!multi_error) { /* first success */
}
} multi_End_Ignore;
-#ifdef AFS_PTHREAD_ENV
- DBHOLD(ubik_dbase);
-#endif
-
if (success_i >= 0) {
UBIK_ADDR_LOCK;
addr = server->addr[success_i]; /* successful interface addr */