diff --git a/src/viced/host.c b/src/viced/host.c index e4501c691d..4edcf43e4d 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -123,6 +123,9 @@ void h_TossStuff_r(struct host *host); #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 @@ -3007,8 +3010,7 @@ h_isBusy_r(struct host *host) return 1; } - if ((host->hostFlags & HWHO_INPROGRESS) || !(host->hostFlags & ALTADDR)) { - /* We shouldn't hit this if the host wasn't locked, but just in case... */ + if (hostBusyFlags(host->hostFlags)) { return 1; } @@ -3471,7 +3473,7 @@ h_stateRestoreHost(struct fs_dump_state * state) osi_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),