From 2313e78e82354390e76ec0d24c7f2229c901e18e Mon Sep 17 00:00:00 2001 From: Mark Vitale Date: Wed, 11 Dec 2013 17:56:47 -0500 Subject: [PATCH] viced: remove dead code CheckHost() Remove CheckHost(). Reviewed-on: http://gerrit.openafs.org/10580 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk Reviewed-by: Andrew Deason Reviewed-by: Jeffrey Altman (cherry picked from commit 76076708a921aae0635975d418dea4b06d2c1af6) Change-Id: I7400a874d9d638ed26f30fc46a01ace5857f1300 Reviewed-on: http://gerrit.openafs.org/10602 Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand Reviewed-by: Mark Vitale Tested-by: BuildBot --- src/viced/host.c | 106 ----------------------------------------------- 1 file changed, 106 deletions(-) diff --git a/src/viced/host.c b/src/viced/host.c index eb5b868ff..4ad35acb2 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -3828,112 +3828,6 @@ static struct AFSFid zerofid; * Since it can serialize them, and pile up, it should be a separate LWP * from other events. */ -#if 0 -static int -CheckHost(struct host *host, int flags, void *rock) -{ - struct client *client; - struct rx_connection *cb_conn = NULL; - int code; - -#ifdef AFS_DEMAND_ATTACH_FS - /* kill the checkhost lwp ASAP during shutdown */ - FS_STATE_RDLOCK; - if (fs_state.mode == FS_MODE_SHUTDOWN) { - FS_STATE_UNLOCK; - return H_ENUMERATE_BAIL(flags); - } - FS_STATE_UNLOCK; -#endif - - /* Host is held by h_Enumerate */ - H_LOCK; - for (client = host->FirstClient; client; client = client->next) { - if (client->refCount == 0 && client->LastCall < clientdeletetime) { - client->deleted = 1; - host->hostFlags |= CLIENTDELETED; - } - } - if (host->LastCall < checktime) { - h_Lock_r(host); - if (!(host->hostFlags & HOSTDELETED)) { - host->hostFlags |= HWHO_INPROGRESS; - cb_conn = host->callback_rxcon; - rx_GetConnection(cb_conn); - if (host->LastCall < clientdeletetime) { - host->hostFlags |= HOSTDELETED; - if (!(host->hostFlags & VENUSDOWN)) { - host->hostFlags &= ~ALTADDR; /* alternate address invalid */ - if (host->interface) { - H_UNLOCK; - code = - RXAFSCB_InitCallBackState3(cb_conn, - &FS_HostUUID); - H_LOCK; - } else { - H_UNLOCK; - code = - RXAFSCB_InitCallBackState(cb_conn); - H_LOCK; - } - host->hostFlags |= ALTADDR; /* alternate addresses valid */ - if (code) { - char hoststr[16]; - (void)afs_inet_ntoa_r(host->host, hoststr); - ViceLog(0, - ("CB: RCallBackConnectBack (host.c) failed for host %s:%d\n", - hoststr, ntohs(host->port))); - host->hostFlags |= VENUSDOWN; - } - /* Note: it's safe to delete hosts even if they have call - * back state, because break delayed callbacks (called when a - * message is received from the workstation) will always send a - * break all call backs to the workstation if there is no - * callback. - */ - } - } else { - if (!(host->hostFlags & VENUSDOWN) && host->cblist) { - char hoststr[16]; - (void)afs_inet_ntoa_r(host->host, hoststr); - if (host->interface) { - afsUUID uuid = host->interface->uuid; - H_UNLOCK; - code = RXAFSCB_ProbeUuid(cb_conn, &uuid); - H_LOCK; - if (code) { - if (MultiProbeAlternateAddress_r(host)) { - ViceLog(0,("CheckHost: Probing all interfaces of host %s:%d failed, code %d\n", - hoststr, ntohs(host->port), code)); - host->hostFlags |= VENUSDOWN; - } - } - } else { - H_UNLOCK; - code = RXAFSCB_Probe(cb_conn); - H_LOCK; - if (code) { - ViceLog(0, - ("CheckHost: Probe failed for host %s:%d, code %d\n", - hoststr, ntohs(host->port), code)); - host->hostFlags |= VENUSDOWN; - } - } - } - } - H_UNLOCK; - rx_PutConnection(cb_conn); - cb_conn=NULL; - H_LOCK; - host->hostFlags &= ~HWHO_INPROGRESS; - } - h_Unlock_r(host); - } - H_UNLOCK; - return held; - -} /*CheckHost */ -#endif int CheckHost_r(struct host *host, void *dummy) -- 2.39.5