#include <rx/rxkad.h>
#include <rx/rx_multi.h>
#include <afs/cellconfig.h>
-#ifndef AFS_NT40_ENV
#include <afs/afsutil.h>
-#endif
#define UBIK_INTERNALS
#include "ubik.h"
now = FT_ApproxTime();
if (beacon_globals.syncSiteUntil <= now) { /* if my votes have expired, say so */
if (beacon_globals.ubik_amSyncSite)
- ubik_dprint("Ubik: I am no longer the sync site\n");
+ ViceLog(5, ("Ubik: I am no longer the sync site\n"));
beacon_globals.ubik_amSyncSite = 0;
beacon_globals.ubik_syncSiteAdvertised = 0;
rcode = 0;
}
}
UBIK_BEACON_UNLOCK;
- ubik_dprint("beacon: amSyncSite is %d\n", rcode);
+ ViceLog(5, ("beacon: amSyncSite is %d\n", rcode));
return rcode;
}
if (ubik_singleServer) {
if (!beacon_globals.ubik_amSyncSite) {
- ubik_dprint("Ubik: I am the sync site - 1 server\n");
+ ViceLog(5, ("Ubik: I am the sync site - 1 server\n"));
DBHOLD(ubik_dbase);
UBIK_VERSION_LOCK;
version_globals.ubik_epochTime = FT_ApproxTime();
* happen due to errors with the rx security class in play
* (rxkad, rxgk, etc). treat the host as if we got a
* timeout, since this is not a valid vote. */
- ubik_print("assuming distant vote time %d from %s is an error; marking host down\n",
- (int)code, afs_inet_ntoa_r(ts->addr[0], hoststr));
+ ViceLog(0, ("assuming distant vote time %d from %s is an error; marking host down\n",
+ (int)code, afs_inet_ntoa_r(ts->addr[0], hoststr)));
code = -1;
}
if (code > 0 && rx_ConnError(connections[multi_i])) {
- ubik_print("assuming vote from %s is invalid due to conn error %d; marking host down\n",
+ ViceLog(0, ("assuming vote from %s is invalid due to conn error %d; marking host down\n",
afs_inet_ntoa_r(ts->addr[0], hoststr),
- (int)rx_ConnError(connections[multi_i]));
+ (int)rx_ConnError(connections[multi_i])));
code = -1;
}
* the latter down below if we got enough votes to go with */
if (code > 0) {
if ((code & ~0xff) == ERROR_TABLE_BASE_RXK) {
- ubik_dprint("token error %d from host %s\n",
- code, afs_inet_ntoa_r(ts->addr[0], hoststr));
+ ViceLog(5, ("token error %d from host %s\n",
+ code, afs_inet_ntoa_r(ts->addr[0], hoststr)));
ts->up = 0;
ts->beaconSinceDown = 0;
urecovery_LostServer(ts);
yesVotes++; /* the extra epsilon */
ts->up = 1; /* server is up (not really necessary: recovery does this for real) */
ts->beaconSinceDown = 1;
- ubik_dprint("yes vote from host %s\n",
- afs_inet_ntoa_r(ts->addr[0], hoststr));
+ ViceLog(5, ("yes vote from host %s\n",
+ afs_inet_ntoa_r(ts->addr[0], hoststr)));
}
} else if (code == 0) {
ts->lastVoteTime = temp;
ts->lastVote = 0;
ts->beaconSinceDown = 1;
- ubik_dprint("no vote from %s\n",
- afs_inet_ntoa_r(ts->addr[0], hoststr));
+ ViceLog(5, ("no vote from %s\n",
+ afs_inet_ntoa_r(ts->addr[0], hoststr)));
} else if (code < 0) {
ts->up = 0;
ts->beaconSinceDown = 0;
urecovery_LostServer(ts);
- ubik_dprint("time out from %s\n",
- afs_inet_ntoa_r(ts->addr[0], hoststr));
+ ViceLog(5, ("time out from %s\n",
+ afs_inet_ntoa_r(ts->addr[0], hoststr)));
}
UBIK_BEACON_UNLOCK;
}
if (yesVotes > nServers) { /* yesVotes is bumped by 2 or 3 for each site */
UBIK_BEACON_LOCK;
if (!beacon_globals.ubik_amSyncSite) {
- ubik_dprint("Ubik: I am the sync site\n");
+ ViceLog(5, ("Ubik: I am the sync site\n"));
/* Defer actually changing any variables until we can take the
* DB lock (which is before the beacon lock in the lock order). */
becameSyncSite = 1;
} else {
UBIK_BEACON_LOCK;
if (beacon_globals.ubik_amSyncSite)
- ubik_dprint("Ubik: I am no longer the sync site\n");
+ ViceLog(5, ("Ubik: I am no longer the sync site\n"));
beacon_globals.ubik_amSyncSite = 0;
beacon_globals.ubik_syncSiteAdvertised = 0;
UBIK_BEACON_UNLOCK;
AFSDIR_SERVER_NETINFO_FILEPATH,
AFSDIR_SERVER_NETRESTRICT_FILEPATH);
if (count < 0) {
- ubik_print("ubik: Can't register any valid addresses:%s\n",
- reason);
- ubik_print("Aborting..\n");
+ ViceLog(0, ("ubik: Can't register any valid addresses:%s\n",
+ reason));
+ ViceLog(0, ("Aborting..\n"));
return UBADHOST;
}
usednetfiles++;
}
if (count <= 0) { /* no address found */
- ubik_print("ubik: No network addresses found, aborting..\n");
+ ViceLog(0, ("ubik: No network addresses found, aborting..\n"));
return UBADHOST;
}
}
if (!found) {
- ubik_print("ubik: primary address %s does not exist\n",
- afs_inet_ntoa_r(*ame, hoststr));
+ ViceLog(0, ("ubik: primary address %s does not exist\n",
+ afs_inet_ntoa_r(*ame, hoststr)));
/* if we had the result of rx_getAllAddr already, avoid subverting
* the "is gethostbyname(gethostname()) us" check. If we're
* using NetInfo/NetRestrict, we assume they have enough clue
*ame = myAddr[0];
tcount = rx_getAllAddr(myAddr2, UBIK_MAX_INTERFACE_ADDR);
if (tcount <= 0) { /* no address found */
- ubik_print("ubik: No network addresses found, aborting..\n");
+ ViceLog(0, ("ubik: No network addresses found, aborting..\n"));
return UBADHOST;
}
}
}
if (found)
- ubik_print("Using %s as my primary address\n", afs_inet_ntoa_r(*ame, hoststr));
+ ViceLog(0, ("Using %s as my primary address\n", afs_inet_ntoa_r(*ame, hoststr)));
if (!info) {
/* get rid of servers which were purged because all
if (ts->addr[0] != htonl(outAddr.hostAddr[0])) {
code = UBADHOST;
strcpy(buffer, afs_inet_ntoa_r(ts->addr[0], hoststr));
- ubik_print("ubik:Two primary addresses for same server \
+ ViceLog(0, ("ubik:Two primary addresses for same server \
%s %s\n", buffer,
- afs_inet_ntoa_r(htonl(outAddr.hostAddr[0]), hoststr));
+ afs_inet_ntoa_r(htonl(outAddr.hostAddr[0]), hoststr)));
} else {
for (j = 1; j < UBIK_MAX_INTERFACE_ADDR; j++)
ts->addr[j] = htonl(outAddr.hostAddr[j]);
UBIK_ADDR_UNLOCK;
} else if (multi_error == RXGEN_OPCODE) { /* pre 3.5 remote server */
UBIK_ADDR_LOCK;
- ubik_print
- ("ubik server %s does not support UpdateInterfaceAddr RPC\n",
- afs_inet_ntoa_r(ts->addr[0], hoststr));
+ ViceLog(0, ("ubik server %s does not support UpdateInterfaceAddr RPC\n",
+ afs_inet_ntoa_r(ts->addr[0], hoststr)));
UBIK_ADDR_UNLOCK;
} else if (multi_error == UBADHOST) {
code = UBADHOST; /* remote CellServDB inconsistency */
- ubik_print("Inconsistent Cell Info on server:\n");
+ ViceLog(0, ("Inconsistent Cell Info on server:\n"));
UBIK_ADDR_LOCK;
for (j = 0; j < UBIK_MAX_INTERFACE_ADDR && ts->addr[j]; j++)
- ubik_print("... %s\n", afs_inet_ntoa_r(ts->addr[j], hoststr));
+ ViceLog(0, ("... %s\n", afs_inet_ntoa_r(ts->addr[j], hoststr)));
UBIK_ADDR_UNLOCK;
} else {
UBIK_BEACON_LOCK;
#else
# include <opr/lockstub.h>
#endif
+#include <afs/afsutil.h>
#define UBIK_INTERNALS
#include "ubik.h"
tb->file = BADFID;
Dlru(tb);
tb->lockers--;
- ubik_print("Ubik: Error reading database file: errno=%d\n", errno);
+ ViceLog(0, ("Ubik: Error reading database file: errno=%d\n", errno));
return 0;
}
ios++;
if (pp == 0) {
/* There are no unlocked buffers that don't need to be written to the disk. */
- ubik_print
- ("Ubik: Internal Error: Unable to find free buffer in ubik cache\n");
+ ViceLog(0, ("Ubik: Internal Error: Unable to find free buffer in ubik cache\n"));
return NULL;
}
UBIK_VERSION_LOCK;
if (version_globals.ubik_epochTime < UBIK_MILESTONE
|| version_globals.ubik_epochTime > now) {
- ubik_print
+ ViceLog(0,
("Ubik: New database label %d is out of the valid range (%d - %d)\n",
- version_globals.ubik_epochTime, UBIK_MILESTONE, now);
+ version_globals.ubik_epochTime, UBIK_MILESTONE, now));
panic("Writing Ubik DB label\n");
}
oldversion = dbase->version;
# include <opr/lock.h>
#endif
#include <lock.h>
+#include <afs/afsutil.h>
#define UBIK_INTERNALS 1
#include "ubik.h"
}
if (atrans->locktype != 0) {
- ubik_print("Ubik: Internal Error: attempted to take lock twice\n");
+ ViceLog(0, ("Ubik: Internal Error: attempted to take lock twice\n"));
abort();
}
/*
- *ubik_print("Ubik: DEBUG: Thread 0x%x request %s lock\n", lwp_cpptr,
- * ((atype == LOCKREAD) ? "READ" : "WRITE"));
+ *ViceLog(0, ("Ubik: DEBUG: Thread 0x%x request %s lock\n", lwp_cpptr,
+ * ((atype == LOCKREAD) ? "READ" : "WRITE")));
*/
/* Check if the lock would would block */
atrans->locktype = atype;
/*
- *ubik_print("Ubik: DEBUG: Thread 0x%x took %s lock\n", lwp_cpptr,
- * ((atype == LOCKREAD) ? "READ" : "WRITE"));
+ *ViceLog(0, ("Ubik: DEBUG: Thread 0x%x took %s lock\n", lwp_cpptr,
+ * ((atype == LOCKREAD) ? "READ" : "WRITE")));
*/
return 0;
}
ulock_relLock(struct ubik_trans *atrans)
{
if (atrans->locktype == LOCKWRITE && (atrans->flags & TRREADWRITE)) {
- ubik_print("Ubik: Internal Error: unlocking write lock with "
- "TRREADWRITE?\n");
+ ViceLog(0, ("Ubik: Internal Error: unlocking write lock with "
+ "TRREADWRITE?\n"));
abort();
}
}
/*
- *ubik_print("Ubik: DEBUG: Thread 0x%x %s unlock\n", lwp_cpptr,
- * ((atrans->locktype == LOCKREAD) ? "READ" : "WRITE"));
+ *ViceLog(0, ("Ubik: DEBUG: Thread 0x%x %s unlock\n", lwp_cpptr,
+ * ((atrans->locktype == LOCKREAD) ? "READ" : "WRITE")));
*/
atrans->locktype = 0;
{
afs_int32 rcode;
- ubik_dprint_25("allbetter checking\n");
+ ViceLog(25, ("allbetter checking\n"));
rcode = 0;
rcode = 1;
}
- ubik_dprint_25("allbetter: returning %d\n", rcode);
+ ViceLog(25, ("allbetter: returning %d\n", rcode));
return rcode;
}
/* otherwise, skip over the data bytes, too */
tpos += ntohl(buffer[2]) + 3 * sizeof(afs_int32);
} else {
- ubik_print("corrupt log opcode (%d) at position %d\n", opcode,
- tpos);
+ ViceLog(0, ("corrupt log opcode (%d) at position %d\n", opcode,
+ tpos));
break; /* corrupt log! */
}
}
code = (*adbase->setlabel) (adbase, 0, &version);
if (code)
return code;
- ubik_print("Successfully replayed log for interrupted "
+ ViceLog(0, ("Successfully replayed log for interrupted "
"transaction; db version is now %ld.%ld\n",
- (long) version.epoch, (long) version.counter);
+ (long) version.epoch, (long) version.counter));
logIsGood = 1;
break; /* all done now */
} else if (opcode == LOGTRUNCATE) {
len -= thisSize;
}
} else {
- ubik_print("corrupt log opcode (%d) at position %d\n",
- opcode, tpos);
+ ViceLog(0, ("corrupt log opcode (%d) at position %d\n",
+ opcode, tpos));
break; /* corrupt log! */
}
}
if (code)
return code;
} else {
- ubik_print("Log read error on pass 2\n");
+ ViceLog(0, ("Log read error on pass 2\n"));
return UBADLOG;
}
}
IOMGR_Select(0, 0, 0, 0, &tv);
#endif
- ubik_dprint("recovery running in state %x\n", urecovery_state);
+ ViceLog(5, ("recovery running in state %x\n", urecovery_state));
/* Every 30 seconds, check all the down servers and mark them
* as up if they respond. When a server comes up or found to
UBIK_ADDR_LOCK;
rxcall = rx_NewCall(bestServer->disk_rxcid);
- ubik_print("Ubik: Synchronize database with server %s\n",
- afs_inet_ntoa_r(bestServer->addr[0], hoststr));
+ ViceLog(0, ("Ubik: Synchronize database with server %s\n",
+ afs_inet_ntoa_r(bestServer->addr[0], hoststr)));
UBIK_ADDR_UNLOCK;
code = StartDISK_GetFile(rxcall, file);
if (code) {
- ubik_dprint("StartDiskGetFile failed=%d\n", code);
+ ViceLog(5, ("StartDiskGetFile failed=%d\n", code));
goto FetchEndCall;
}
nbytes = rx_Read(rxcall, (char *)&length, sizeof(afs_int32));
length = ntohl(length);
if (nbytes != sizeof(afs_int32)) {
- ubik_dprint("Rx-read length error=%d\n", code = BULK_ERROR);
+ ViceLog(5, ("Rx-read length error=%d\n", code = BULK_ERROR));
code = EIO;
goto FetchEndCall;
}
code = (*ubik_dbase->setlabel) (ubik_dbase, file, &tversion);
UBIK_VERSION_UNLOCK;
if (code) {
- ubik_dprint("setlabel io error=%d\n", code);
+ ViceLog(5, ("setlabel io error=%d\n", code));
goto FetchEndCall;
}
snprintf(pbuffer, sizeof(pbuffer), "%s.DB%s%d.TMP",
#endif
nbytes = rx_Read(rxcall, tbuffer, tlen);
if (nbytes != tlen) {
- ubik_dprint("Rx-read bulk error=%d\n", code = BULK_ERROR);
+ ViceLog(5, ("Rx-read bulk error=%d\n", code = BULK_ERROR));
code = EIO;
close(fd);
goto FetchEndCall;
ubik_dbase->version.epoch = 0;
ubik_dbase->version.counter = 0;
UBIK_VERSION_UNLOCK;
- ubik_print("Ubik: Synchronize database failed (error = %d)\n",
- code);
+ ViceLog(0, ("Ubik: Synchronize database failed (error = %d)\n",
+ code));
} else {
- ubik_print("Ubik: Synchronize database completed\n");
+ ViceLog(0, ("Ubik: Synchronize database completed\n"));
urecovery_state |= UBIK_RECHAVEDB;
}
udisk_Invalidate(ubik_dbase, 0); /* data has changed */
UBIK_BEACON_LOCK;
if (!ts->up) {
UBIK_BEACON_UNLOCK;
- ubik_dprint("recovery cannot send version to %s\n",
- afs_inet_ntoa_r(inAddr.s_addr, hoststr));
+ ViceLog(5, ("recovery cannot send version to %s\n",
+ afs_inet_ntoa_r(inAddr.s_addr, hoststr)));
dbok = 0;
continue;
}
UBIK_BEACON_UNLOCK;
- ubik_dprint("recovery sending version to %s\n",
- afs_inet_ntoa_r(inAddr.s_addr, hoststr));
+ ViceLog(5, ("recovery sending version to %s\n",
+ afs_inet_ntoa_r(inAddr.s_addr, hoststr)));
if (vcmp(ts->version, ubik_dbase->version) != 0) {
- ubik_dprint("recovery stating local database\n");
+ ViceLog(5, ("recovery stating local database\n"));
/* Rx code to do the Bulk Store */
code = (*ubik_dbase->stat) (ubik_dbase, 0, &ubikstat);
StartDISK_SendFile(rxcall, file, length,
&ubik_dbase->version);
if (code) {
- ubik_dprint("StartDiskSendFile failed=%d\n",
- code);
+ ViceLog(5, ("StartDiskSendFile failed=%d\n",
+ code));
goto StoreEndCall;
}
while (length > 0) {
(*ubik_dbase->read) (ubik_dbase, file,
tbuffer, offset, tlen);
if (nbytes != tlen) {
- ubik_dprint("Local disk read error=%d\n",
- code = UIOERROR);
+ ViceLog(5, ("Local disk read error=%d\n",
+ code = UIOERROR));
goto StoreEndCall;
}
nbytes = rx_Write(rxcall, tbuffer, tlen);
if (nbytes != tlen) {
- ubik_dprint("Rx-write bulk error=%d\n", code =
- BULK_ERROR);
+ ViceLog(5, ("Rx-write bulk error=%d\n", code =
+ BULK_ERROR));
goto StoreEndCall;
}
offset += tlen;
connSuccess = conns[success_i];
strcpy(buffer, afs_inet_ntoa_r(server->addr[0], hoststr));
- ubik_print("ubik:server %s is back up: will be contacted through %s\n",
- buffer, afs_inet_ntoa_r(addr, hoststr));
+ ViceLog(0, ("ubik:server %s is back up: will be contacted through %s\n",
+ buffer, afs_inet_ntoa_r(addr, hoststr)));
UBIK_ADDR_UNLOCK;
}
rx_DestroyConnection(conns[i]);
if (!connSuccess)
- ubik_dprint("ubik:server %s still down\n",
- afs_inet_ntoa_r(server->addr[0], hoststr));
+ ViceLog(5, ("ubik:server %s still down\n",
+ afs_inet_ntoa_r(server->addr[0], hoststr)));
if (connSuccess)
return 0; /* success */
code = rx_Write(rxcall, (char *)&tlen, sizeof(afs_int32));
if (code != sizeof(afs_int32)) {
DBRELE(dbase);
- ubik_dprint("Rx-write length error=%d\n", code);
+ ViceLog(5, ("Rx-write length error=%d\n", code));
return BULK_ERROR;
}
offset = 0;
code = (*dbase->read) (dbase, file, tbuffer, offset, tlen);
if (code != tlen) {
DBRELE(dbase);
- ubik_dprint("read failed error=%d\n", code);
+ ViceLog(5, ("read failed error=%d\n", code));
return UIOERROR;
}
code = rx_Write(rxcall, tbuffer, tlen);
if (code != tlen) {
DBRELE(dbase);
- ubik_dprint("Rx-write length error=%d\n", code);
+ ViceLog(5, ("Rx-write length error=%d\n", code));
return BULK_ERROR;
}
length -= tlen;
if (offset && offset != otherHost) {
/* we *know* this is the wrong guy */
char sync_hoststr[16];
- ubik_print
+ ViceLog(0,
("Ubik: Refusing synchronization with server %s since it is not the sync-site (%s).\n",
afs_inet_ntoa_r(otherHost, hoststr),
- afs_inet_ntoa_r(offset, sync_hoststr));
+ afs_inet_ntoa_r(offset, sync_hoststr)));
return USYNC;
}
/* abort any active trans that may scribble over the database */
urecovery_AbortAll(dbase);
- ubik_print("Ubik: Synchronize database with server %s\n",
- afs_inet_ntoa_r(otherHost, hoststr));
+ ViceLog(0, ("Ubik: Synchronize database with server %s\n",
+ afs_inet_ntoa_r(otherHost, hoststr)));
offset = 0;
UBIK_VERSION_LOCK;
#endif
code = rx_Read(rxcall, tbuffer, tlen);
if (code != tlen) {
- ubik_dprint("Rx-read length error=%d\n", code);
+ ViceLog(5, ("Rx-read length error=%d\n", code));
code = BULK_ERROR;
close(fd);
goto failed;
code = write(fd, tbuffer, tlen);
pass++;
if (code != tlen) {
- ubik_dprint("write failed error=%d\n", code);
+ ViceLog(5, ("write failed error=%d\n", code));
code = UIOERROR;
close(fd);
goto failed;
(*dbase->setlabel) (dbase, file, &tversion);
UBIK_VERSION_UNLOCK;
}
- ubik_print
- ("Ubik: Synchronize database with server %s failed (error = %d)\n",
- afs_inet_ntoa_r(otherHost, hoststr), code);
+ ViceLog(0, ("Ubik: Synchronize database with server %s failed (error = %d)\n",
+ afs_inet_ntoa_r(otherHost, hoststr), code));
} else {
uvote_set_dbVersion(*avers);
- ubik_print("Ubik: Synchronize database completed\n");
+ ViceLog(0, ("Ubik: Synchronize database completed\n"));
}
DBRELE(dbase);
return code;
/* if (probableMatch) */
/* inconsistent addresses in CellServDB */
if (!probableMatch || found) {
- ubik_print("Inconsistent Cell Info from server:\n");
+ ViceLog(0, ("Inconsistent Cell Info from server:\n"));
for (i = 0; i < UBIK_MAX_INTERFACE_ADDR && inAddr->hostAddr[i]; i++)
- ubik_print("... %s\n", afs_inet_ntoa_r(htonl(inAddr->hostAddr[i]), hoststr));
+ ViceLog(0, ("... %s\n", afs_inet_ntoa_r(htonl(inAddr->hostAddr[i]), hoststr)));
fflush(stdout);
fflush(stderr);
printServerInfo();
for (i = 1; i < UBIK_MAX_INTERFACE_ADDR; i++)
ts->addr[i] = htonl(inAddr->hostAddr[i]);
- ubik_print("ubik: A Remote Server has addresses:\n");
+ ViceLog(0, ("ubik: A Remote Server has addresses:\n"));
for (i = 0; i < UBIK_MAX_INTERFACE_ADDR && ts->addr[i]; i++)
- ubik_print("... %s\n", afs_inet_ntoa_r(ts->addr[i], hoststr));
+ ViceLog(0, ("... %s\n", afs_inet_ntoa_r(ts->addr[i], hoststr)));
UBIK_ADDR_UNLOCK;
int i, j = 1;
char hoststr[16];
- ubik_print("Local CellServDB:\n");
+ ViceLog(0, ("Local CellServDB:\n"));
for (ts = ubik_servers; ts; ts = ts->next, j++) {
- ubik_print(" Server %d:\n", j);
+ ViceLog(0, (" Server %d:\n", j));
for (i = 0; (i < UBIK_MAX_INTERFACE_ADDR) && ts->addr[i]; i++)
- ubik_print(" ... %s\n", afs_inet_ntoa_r(ts->addr[i], hoststr));
+ ViceLog(0, (" ... %s\n", afs_inet_ntoa_r(ts->addr[i], hoststr)));
}
}
#include <lock.h>
#include <rx/rx.h>
#include <afs/cellconfig.h>
+#include <afs/afsutil.h>
#define UBIK_INTERNALS
rx_NewService(0, VOTE_SERVICE_ID, "VOTE", ubik_sc, numClasses,
VOTE_ExecuteRequest);
if (tservice == (struct rx_service *)0) {
- ubik_dprint("Could not create VOTE rx service!\n");
+ ViceLog(5, ("Could not create VOTE rx service!\n"));
return -1;
}
rx_SetMinProcs(tservice, 2);
rx_NewService(0, DISK_SERVICE_ID, "DISK", ubik_sc, numClasses,
DISK_ExecuteRequest);
if (tservice == (struct rx_service *)0) {
- ubik_dprint("Could not create DISK rx service!\n");
+ ViceLog(5, ("Could not create DISK rx service!\n"));
return -1;
}
rx_SetMinProcs(tservice, 2);
/* it's not safe to use ubik_BeginTransReadAnyWrite without a
* cache-syncing function; fall back to ubik_BeginTransReadAny,
* which is safe but slower */
- ubik_print("ubik_BeginTransReadAnyWrite called, but "
+ ViceLog(0, ("ubik_BeginTransReadAnyWrite called, but "
"ubik_SyncWriterCacheProc not set; pretending "
- "ubik_BeginTransReadAny was called instead\n");
+ "ubik_BeginTransReadAny was called instead\n"));
readAny = 1;
}
* to us, or timeout. Put safety check in anyway */
if (now - realStart > 10 * BIGTIME) {
ubik_stats.escapes++;
- ubik_print("ubik escaping from commit wait\n");
+ ViceLog(0, ("ubik escaping from commit wait\n"));
break;
}
for (ts = ubik_servers; ts; ts = ts->next) {
va_list ap;
va_start(ap, format);
- ubik_print("Ubik PANIC:\n");
- ubik_vprint(format, ap);
+ ViceLog(0, ("Ubik PANIC:\n"));
+ vViceLog(0, (format, ap));
va_end(ap);
abort();
- ubik_print("BACK FROM ABORT\n"); /* shouldn't come back */
+ ViceLog(0, ("BACK FROM ABORT\n")); /* shouldn't come back */
exit(1); /* never know, though */
}
extern int uvote_ShouldIRun(void);
extern afs_int32 uvote_GetSyncSite(void);
extern int uvote_Init(void);
-extern void ubik_vprint(const char *format, va_list ap)
- AFS_ATTRIBUTE_FORMAT(__printf__, 1, 0);
-
-extern void ubik_print(const char *format, ...)
- AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2);
-
-extern void ubik_dprint(const char *format, ...)
- AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2);
-
-extern void ubik_dprint_25(const char *format, ...)
- AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2);
extern struct vote_data vote_globals;
extern void uvote_set_dbVersion(struct ubik_version);
extern int uvote_eq_dbVersion(struct ubik_version);
/* This is the identifier that ubik uses. */
otherHost = ubikGetPrimaryInterfaceAddr(otherHost);
if (!otherHost) {
- ubik_dprint("Received beacon from unknown host %s\n",
- afs_inet_ntoa_r(rx_HostOf(rxp), hoststr));
+ ViceLog(5, ("Received beacon from unknown host %s\n",
+ afs_inet_ntoa_r(rx_HostOf(rxp), hoststr)));
return 0; /* I don't know about you: vote no */
}
for (ts = ubik_servers; ts; ts = ts->next) {
break;
}
if (!ts)
- ubik_dprint("Unknown host %x has sent a beacon\n", otherHost);
+ ViceLog(5, ("Unknown host %x has sent a beacon\n", otherHost));
if (ts && ts->isClone)
isClone = 1;
} else {
isClone = amIClone;
}
- ubik_dprint("Received beacon type %d from host %s\n", astate,
- afs_inet_ntoa_r(otherHost, hoststr));
+ ViceLog(5, ("Received beacon type %d from host %s\n", astate,
+ afs_inet_ntoa_r(otherHost, hoststr)));
/* compute the lowest server we've heard from. We'll try to only vote for
* this dude if we don't already have a synchronization site. Also, don't
vote_globals.syncTime = now;
} else if (vote_globals.syncTime + BIGTIME < now) {
if (vote_globals.syncHost) {
- ubik_dprint
- ("Ubik: Lost contact with sync-site %s (NOT in quorum)\n",
- afs_inet_ntoa_r(vote_globals.syncHost, hoststr));
+ ViceLog(5, ("Ubik: Lost contact with sync-site %s (NOT in quorum)\n",
+ afs_inet_ntoa_r(vote_globals.syncHost, hoststr)));
}
vote_globals.syncHost = 0;
}
if ((vote_globals.ubik_lastYesTime + BIGTIME < now) || (otherHost != vote_globals.lastYesHost)
|| (vote_globals.lastYesState != astate)) {
/* A new vote or a change in the vote or changed quorum */
- ubik_dprint("Ubik: vote 'yes' for %s %s\n",
+ ViceLog(5, ("Ubik: vote 'yes' for %s %s\n",
afs_inet_ntoa_r(otherHost, hoststr),
- (astate ? "(in quorum)" : "(NOT in quorum)"));
+ (astate ? "(in quorum)" : "(NOT in quorum)")));
}
vote = now; /* vote yes */
return 0;
}
-void
-ubik_dprint_25(const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- vViceLog(25, (format, ap));
- va_end(ap);
-}
-
-void
-ubik_dprint(const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- vViceLog(5, (format, ap));
- va_end(ap);
-}
-
-void
-ubik_vprint(const char *format, va_list ap)
-{
- vViceLog(0, (format, ap));
-}
-
-void
-ubik_print(const char *format, ...)
-{
- va_list ap;
-
- va_start(ap, format);
- ubik_vprint(format, ap);
- va_end(ap);
-}
-
/*!
* \brief Called once/run to init the vote module
*/