extern int SystemId;
extern int AnonymousID;
extern prlist AnonCPS;
-extern int LogLevel;
extern struct afsconf_dir *confDir; /* config dir object */
extern int lwps; /* the max number of server threads */
extern afsUUID FS_HostUUID;
#define IN_CLASSB_SUBNET 0xffffff00
#endif
+#define hostBusyFlags(hf) \
+ ((hf) & (HWHO_INPROGRESS | HCPS_INPROGRESS | HCPS_WAITING) \
+ || !((hf) & ALTADDR))
/* get a new block of CEs and chain it on CEFree */
static void
if (code)
return code;
- code = ubik_PR_IDToName(uclient, 0, ids, names);
+ code = string_PR_IDToName(uclient, 0, ids, names);
return code;
}
if (chain->hostPtr->z.interface &&
afs_uuid_equal(&chain->hostPtr->z.interface->uuid, uuid)) {
- if (LogLevel >= 125) {
+ if (GetLogLevel() >= 125) {
afsUUID_to_string(&chain->hostPtr->z.interface->uuid, uuid1,
127);
afsUUID_to_string(uuid, uuid2, 127);
chain->hostPtr = host;
chain->next = hostUuidHashTable[index];
hostUuidHashTable[index] = chain;
- if (LogLevel < 125)
+ if (GetLogLevel() < 125)
return;
afsUUID_to_string(uuid, uuid2, 127);
ViceLog(125,
/* hash into proper bucket */
index = h_UuidHashIndex(&host->z.interface->uuid);
- if (LogLevel >= 125)
+ if (GetLogLevel() >= 125)
afsUUID_to_string(&host->z.interface->uuid, uuid1, 127);
for (uhp = &hostUuidHashTable[index]; (uth = *uhp); uhp = &uth->next) {
opr_Assert(uth->hostPtr);
return 1;
}
- if ((host->z.hostFlags & HWHO_INPROGRESS) || !(host->z.hostFlags & ALTADDR)) {
- /* We shouldn't hit this if the host wasn't locked, but just in case... */
+ if (hostBusyFlags(host->z.hostFlags)) {
return 1;
}
opr_Assert(hcps != NULL);
}
- if ((hdsk.hostFlags & HWHO_INPROGRESS) || !(hdsk.hostFlags & ALTADDR)) {
+ if (hostBusyFlags(hdsk.hostFlags)) {
char hoststr[16];
ViceLog(0, ("h_stateRestoreHost: skipping host %s:%d due to invalid flags 0x%x\n",
afs_inet_ntoa_r(hdsk.host, hoststr), (int)ntohs(hdsk.port),
h_AddHostToUuidHashTable_r(&interface->uuid, host);
- if (LogLevel >= 125) {
+ if (GetLogLevel() >= 125) {
afsUUID_to_string(&interface->uuid, uuidstr, 127);
ViceLog(125, ("--- uuid %s\n", uuidstr));