viced: Move host quota calculation
[openafs.git] / src / viced / host.c
index 6eadd5b..c24841c 100644 (file)
 
 #include <roken.h>
 #include <afs/opr.h>
+#include <opr/lock.h>
 
 #ifdef HAVE_SYS_FILE_H
 #include <sys/file.h>
 #endif
 
-#include <rx/xdr.h>
-#include <lwp.h>
-#include <lock.h>
 #include <afs/afsint.h>
 #define FSINT_COMMON_XG
 #include <afs/afscbint.h>
@@ -30,8 +28,6 @@
 #include <afs/nfs.h>
 #include <afs/errors.h>
 #include <afs/ihandle.h>
-#include <afs/vnode.h>
-#include <afs/volume.h>
 #include <afs/acl.h>
 #include <afs/ptclient.h>
 #include <afs/ptuser.h>
@@ -61,6 +57,7 @@ extern int LogLevel;
 extern struct afsconf_dir *confDir;    /* config dir object */
 extern int lwps;               /* the max number of server threads */
 extern afsUUID FS_HostUUID;
+extern char *FS_configPath;
 
 afsUUID nulluuid;
 int CEs = 0;                   /* active clients */
@@ -72,16 +69,18 @@ int rxcon_ident_key;
 int rxcon_client_key;
 
 static struct rx_securityClass *sc = NULL;
+static int h_quota_limit;
 
 /* arguments for PerHost_EnumerateClient enumeration */
 struct enumclient_args {
-    afs_int32 vid;
+    VolumeId vid;
     int (*proc)(struct client *client, void *rock);
     void *rock;
 };
 
 static void h_SetupCallbackConn_r(struct host * host);
 static int h_threadquota(int);
+static int initInterfaceAddr_r(struct host *, struct interfaceAddr *);
 
 #define CESPERBLOCK 73
 struct CEBlock {               /* block of CESPERBLOCK file entries */
@@ -211,7 +210,7 @@ GetHTBlock(void)
        ShutDownAndCore(PANIC);
     }
     for (i = 0; i < (h_HTSPERBLOCK); i++)
-       CV_INIT(&block->entry[i].cond, "block entry", CV_DEFAULT, 0);
+       opr_cv_init(&block->entry[i].cond);
     for (i = 0; i < (h_HTSPERBLOCK); i++)
        Lock_Init(&block->entry[i].lock);
     for (i = 0; i < (h_HTSPERBLOCK - 1); i++)
@@ -266,9 +265,11 @@ hpr_Initialize(struct ubik_client **uclient)
     afs_int32 i;
     char cellstr[64];
 
-    tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH);
+    tdir = afsconf_Open(FS_configPath);
     if (!tdir) {
-       ViceLog(0, ("hpr_Initialize: Could not open configuration directory: %s", AFSDIR_SERVER_ETC_DIRPATH));
+       ViceLog(0,
+               ("hpr_Initialize: Could not open configuration directory: %s",
+                FS_configPath));
        return -1;
     }
 
@@ -350,7 +351,7 @@ getThreadClient(struct ubik_client **client)
     if (code)
        return code;
 
-    osi_Assert(pthread_setspecific(viced_uclient_key, *client) == 0);
+    opr_Verify(pthread_setspecific(viced_uclient_key, *client) == 0);
 
     return 0;
 }
@@ -562,7 +563,7 @@ h_gethostcps_r(struct host *host, afs_int32 now)
     while (host->hostFlags & HCPS_INPROGRESS) {
        slept = 1;              /* I did sleep */
        host->hostFlags |= HCPS_WAITING;        /* I am sleeping now */
-       CV_WAIT(&host->cond, &host_glock_mutex);
+       opr_cv_wait(&host->cond, &host_glock_mutex);
     }
 
 
@@ -571,7 +572,7 @@ h_gethostcps_r(struct host *host, afs_int32 now)
        free(host->hcps.prlist_val);    /* this is for hostaclRefresh */
     host->hcps.prlist_val = NULL;
     host->hcps.prlist_len = 0;
-    host->cpsCall = slept ? (FT_ApproxTime()) : (now);
+    host->cpsCall = slept ? time(NULL) : (now);
 
     H_UNLOCK;
     code = hpr_GetHostCPS(ntohl(host->host), &host->hcps);
@@ -618,7 +619,7 @@ h_gethostcps_r(struct host *host, afs_int32 now)
     /* signal all who are waiting */
     if (host->hostFlags & HCPS_WAITING) {      /* somebody is waiting */
        host->hostFlags &= ~HCPS_WAITING;
-       CV_BROADCAST(&host->cond);
+       opr_cv_broadcast(&host->cond);
     }
 }
 
@@ -683,7 +684,7 @@ h_Alloc_r(struct rx_connection *r_con)
     /* Make a callback channel even for the console, on the off chance that it
      * makes a request that causes a break call back.  It shouldn't. */
     h_SetupCallbackConn_r(host);
-    host->LastCall = host->cpsCall = host->ActiveCall = FT_ApproxTime();
+    host->LastCall = host->cpsCall = host->ActiveCall = time(NULL);
     host->hostFlags = 0;
     host->hcps.prlist_val = NULL;
     host->hcps.prlist_len = 0;
@@ -739,7 +740,7 @@ h_Lookup_r(afs_uint32 haddr, afs_uint16 hport, struct host **hostp)
   restart:
     for (chain = hostAddrHashTable[index]; chain; chain = chain->next) {
        host = chain->hostPtr;
-       osi_Assert(host);
+       opr_Assert(host);
        if (!(host->hostFlags & HOSTDELETED) && chain->addr == haddr
            && chain->port == hport) {
            if ((host->hostFlags & HWHO_INPROGRESS) &&
@@ -756,7 +757,7 @@ h_Lookup_r(afs_uint32 haddr, afs_uint16 hport, struct host **hostp)
                goto restart;
            }
            h_Unlock_r(host);
-           now = FT_ApproxTime();      /* always evaluate "now" */
+           now = time(NULL);   /* always evaluate "now" */
            if (host->hcpsfailed || (host->cpsCall + hostaclRefresh < now)) {
                /*
                 * Every hostaclRefresh period (def 2 hrs) get the new
@@ -786,7 +787,7 @@ h_LookupUuid_r(afsUUID * uuidp)
 
     for (chain = hostUuidHashTable[index]; chain; chain = chain->next) {
        host = chain->hostPtr;
-       osi_Assert(host);
+       opr_Assert(host);
        if (!(host->hostFlags & HOSTDELETED) && host->interface
            && afs_uuid_equal(&host->interface->uuid, uuidp)) {
             return host;
@@ -1169,7 +1170,7 @@ h_DeleteHostFromUuidHashTable_r(struct host *host)
      if (LogLevel >= 125)
         afsUUID_to_string(&host->interface->uuid, uuid1, 127);
      for (uhp = &hostUuidHashTable[index]; (uth = *uhp); uhp = &uth->next) {
-         osi_Assert(uth->hostPtr);
+         opr_Assert(uth->hostPtr);
         if (uth->hostPtr == host) {
             ViceLog(125,
                     ("h_DeleteHostFromUuidHashTable_r: host %" AFS_PTR_FMT " (uuid %s %s:%d)\n",
@@ -1200,8 +1201,8 @@ invalidateInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port)
     struct Interface *interface;
     char hoststr[16], hoststr2[16];
 
-    osi_Assert(host);
-    osi_Assert(host->interface);
+    opr_Assert(host);
+    opr_Assert(host->interface);
 
     ViceLog(125, ("invalidateInterfaceAddr : host %" AFS_PTR_FMT " (%s:%d) addr %s:%d\n",
                  host, afs_inet_ntoa_r(host->host, hoststr),
@@ -1354,7 +1355,7 @@ reconcileHosts_r(afs_uint32 addr, afs_uint16 port, struct host *newHost,
             AFS_PTR_FMT, afs_inet_ntoa_r(addr, hoststr), ntohs(port),
             newHost, oldHost));
 
-    osi_Assert(oldHost != newHost);
+    opr_Assert(oldHost != newHost);
     caps.Capabilities_val = NULL;
 
     if (!sc) {
@@ -1504,8 +1505,8 @@ addInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port)
     struct Interface *interface;
     char hoststr[16], hoststr2[16];
 
-    osi_Assert(host);
-    osi_Assert(host->interface);
+    opr_Assert(host);
+    opr_Assert(host->interface);
 
     /*
      * Make sure this address is on the list of known addresses
@@ -1570,8 +1571,8 @@ removeInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port)
     struct Interface *interface;
     char hoststr[16], hoststr2[16];
 
-    osi_Assert(host);
-    osi_Assert(host->interface);
+    opr_Assert(host);
+    opr_Assert(host->interface);
 
     ViceLog(125, ("removeInterfaceAddr : host %" AFS_PTR_FMT " (%s:%d) addr %s:%d\n",
                  host, afs_inet_ntoa_r(host->host, hoststr),
@@ -1606,18 +1607,8 @@ removeInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port)
 static int
 h_threadquota(int waiting)
 {
-    if (lwps > 64) {
-       if (waiting > 5)
-           return 1;
-    } else if (lwps > 32) {
-       if (waiting > 4)
-           return 1;
-    } else if (lwps > 16) {
-       if (waiting > 3)
-           return 1;
-    } else {
-       if (waiting > 2)
-           return 1;
+    if (waiting > h_quota_limit) {
+       return 1;
     }
     return 0;
 }
@@ -1939,7 +1930,7 @@ h_GetHost_r(struct rx_connection *tcon)
        host = h_Alloc_r(tcon); /* returned held and locked */
        if (!host)
            goto gethost_out;
-       h_gethostcps_r(host, FT_ApproxTime());
+       h_gethostcps_r(host, time(NULL));
        if (!(host->Console & 1)) {
            int pident = 0;
            cb_conn = host->callback_rxcon;
@@ -2127,7 +2118,9 @@ h_GetHost_r(struct rx_connection *tcon)
                    /* the new host is held and locked */
                } else {
                    /* This really is a new host */
-                   h_AddHostToUuidHashTable_r(&identP->uuid, host);
+                   opr_Assert(interfValid == 1);
+                   initInterfaceAddr_r(host, &interf);
+
                    cb_conn = host->callback_rxcon;
                    rx_GetConnection(cb_conn);
                    H_UNLOCK;
@@ -2142,8 +2135,6 @@ h_GetHost_r(struct rx_connection *tcon)
                                ("InitCallBackState3 success on host %" AFS_PTR_FMT " (%s:%d)\n",
                                 host, afs_inet_ntoa_r(host->host, hoststr),
                                 ntohs(host->port)));
-                       osi_Assert(interfValid == 1);
-                       initInterfaceAddr_r(host, &interf);
                    }
                }
            }
@@ -2183,17 +2174,17 @@ h_GetHost_r(struct rx_connection *tcon)
 }                              /*h_GetHost_r */
 
 
-static char localcellname[PR_MAXNAMELEN + 1];
-
 /* not reentrant */
 void
-h_InitHostPackage(void)
+h_InitHostPackage(int hquota)
 {
+    opr_Assert(hquota > 0);
+    h_quota_limit = hquota;
+
     memset(&nulluuid, 0, sizeof(afsUUID));
-    afsconf_GetLocalCell(confDir, localcellname, PR_MAXNAMELEN);
     rxcon_ident_key = rx_KeyCreate((rx_destructor_t) free);
     rxcon_client_key = rx_KeyCreate((rx_destructor_t) 0);
-    MUTEX_INIT(&host_glock_mutex, "host glock", MUTEX_DEFAULT, 0);
+    opr_mutex_init(&host_glock_mutex);
 }
 
 static int
@@ -2261,7 +2252,7 @@ PerHost_EnumerateClient(struct host *host, void *arock)
 }
 
 void
-h_EnumerateClients(afs_int32 vid,
+h_EnumerateClients(VolumeId vid,
                    int (*proc)(struct client *client, void *rock),
                    void *rock)
 {
@@ -2380,9 +2371,12 @@ getPeerDetails(struct rx_connection *conn,
  *
  * The refCount on client->host is returned incremented.  h_ReleaseClient_r
  * does not decrement the refCount on client->host.
+ *
+ * *a_viceid is set to the user's ViceId, even if we don't return a client
+ * struct.
  */
 struct client *
-h_FindClient_r(struct rx_connection *tcon)
+h_FindClient_r(struct rx_connection *tcon, afs_int32 *a_viceid)
 {
     struct client *client;
     struct host *host = NULL;
@@ -2401,6 +2395,9 @@ h_FindClient_r(struct rx_connection *tcon)
        && !(client->host->hostFlags & HOSTDELETED)
        && !client->deleted) {
 
+       if (a_viceid) {
+           *a_viceid = client->ViceId;
+       }
        client->refCount++;
        h_Hold_r(client->host);
        if (client->prfail != 2) {
@@ -2425,6 +2422,10 @@ h_FindClient_r(struct rx_connection *tcon)
     if (code)
        fail = 1;
 
+    if (a_viceid) {
+       *a_viceid = viceid;
+    }
+
     if (!client) { /* loop */
        host = h_GetHost_r(tcon);       /* Returns with incremented refCount  */
 
@@ -2617,7 +2618,7 @@ h_FindClient_r(struct rx_connection *tcon)
 int
 h_ReleaseClient_r(struct client *client)
 {
-    osi_Assert(client->refCount > 0);
+    opr_Assert(client->refCount > 0);
     client->refCount--;
     return 0;
 }
@@ -2810,7 +2811,7 @@ h_PrintClients(void)
                 AFSDIR_SERVER_CLNTDUMP_FILEPATH));
        return;
     }
-    now = FT_ApproxTime();
+    now = time(NULL);
     strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y",
             localtime_r(&now, &tm));
     snprintf(tmpStr, sizeof tmpStr, "List of active users at %s\n\n",
@@ -2884,7 +2885,7 @@ h_DumpHosts(void)
                 AFSDIR_SERVER_HOSTDUMP_FILEPATH));
        return;
     }
-    now = FT_ApproxTime();
+    now = time(NULL);
     strftime(tbuffer, sizeof(tbuffer), "%a %b %d %H:%M:%S %Y",
             localtime_r(&now, &tm));
     snprintf(tmpStr, sizeof tmpStr, "List of active hosts at %s\n\n", tbuffer);
@@ -3165,7 +3166,7 @@ h_stateVerifyAddrHash(struct fs_dump_state * state, struct host * h,
 static int
 h_stateVerifyUuidHash(struct fs_dump_state * state, struct host * h)
 {
-    int ret = 0, found = 0;
+    int ret = 0;
     struct host *host = NULL;
     struct h_UuidHashChain *chain;
     afsUUID * uuidp = &h->interface->uuid;
@@ -3188,7 +3189,6 @@ h_stateVerifyUuidHash(struct fs_dump_state * state, struct host * h)
                            h->index, host->index));
                state->flags.warnings_generated = 1;
            }
-           found = 1;
            goto done;
        }
        if (chain_len > FS_STATE_H_MAX_UUID_HASH_CHAIN_LEN) {
@@ -3200,16 +3200,16 @@ h_stateVerifyUuidHash(struct fs_dump_state * state, struct host * h)
        chain_len++;
     }
 
-    if (!found) {
-       afsUUID_to_string(uuidp, tmp, sizeof(tmp));
-       if (state->mode == FS_STATE_LOAD_MODE) {
-           ViceLog(0, ("h_stateVerifyUuidHash: error: uuid %s not found in hash\n", tmp));
-           ret = 1;
-           goto done;
-       } else {
-           ViceLog(0, ("h_stateVerifyUuidHash: warning: uuid %s not found in hash\n", tmp));
-           state->flags.warnings_generated = 1;
-       }
+    /* Fall through, so host not found */
+
+    afsUUID_to_string(uuidp, tmp, sizeof(tmp));
+    if (state->mode == FS_STATE_LOAD_MODE) {
+       ViceLog(0, ("h_stateVerifyUuidHash: error: uuid %s not found in hash\n", tmp));
+       ret = 1;
+       goto done;
+    } else {
+       ViceLog(0, ("h_stateVerifyUuidHash: warning: uuid %s not found in hash\n", tmp));
+       state->flags.warnings_generated = 1;
     }
 
  done:
@@ -3286,7 +3286,7 @@ h_stateSaveHost(struct host * host, void* rock)
        if_len = sizeof(struct Interface) +
            ((host->interface->numberOfInterfaces-1) * sizeof(struct AddrPort));
        ifp = malloc(if_len);
-       osi_Assert(ifp != NULL);
+       opr_Assert(ifp != NULL);
        memcpy(ifp, host->interface, if_len);
        hdr.interfaces = host->interface->numberOfInterfaces;
        iov[iovcnt].iov_base = (char *) ifp;
@@ -3297,7 +3297,7 @@ h_stateSaveHost(struct host * host, void* rock)
        hdr.hcps = host->hcps.prlist_len;
        hcps_len = hdr.hcps * sizeof(afs_int32);
        hcps = malloc(hcps_len);
-       osi_Assert(hcps != NULL);
+       opr_Assert(hcps != NULL);
        memcpy(hcps, host->hcps.prlist_val, hcps_len);
        iov[iovcnt].iov_base = (char *) hcps;
        iov[iovcnt].iov_len = hcps_len;
@@ -3369,7 +3369,7 @@ h_stateRestoreHost(struct fs_dump_state * state)
        ifp_len = sizeof(struct Interface) +
            ((hdr.interfaces-1) * sizeof(struct AddrPort));
        ifp = malloc(ifp_len);
-       osi_Assert(ifp != NULL);
+       opr_Assert(ifp != NULL);
        iov[iovcnt].iov_base = (char *) ifp;
        iov[iovcnt].iov_len = ifp_len;
        iovcnt++;
@@ -3377,7 +3377,7 @@ h_stateRestoreHost(struct fs_dump_state * state)
     if (hdr.hcps) {
        hcps_len = hdr.hcps * sizeof(afs_int32);
        hcps = malloc(hcps_len);
-       osi_Assert(hcps != NULL);
+       opr_Assert(hcps != NULL);
        iov[iovcnt].iov_base = (char *) hcps;
        iov[iovcnt].iov_len = hcps_len;
        iovcnt++;
@@ -3398,7 +3398,7 @@ h_stateRestoreHost(struct fs_dump_state * state)
     if (!hdr.hcps && hdsk.hcps_valid) {
        /* valid, zero-length host cps ; does this ever happen? */
        hcps = malloc(sizeof(afs_int32));
-       osi_Assert(hcps != NULL);
+       opr_Assert(hcps != NULL);
     }
 
     if ((hdsk.hostFlags & HWHO_INPROGRESS) || !(hdsk.hostFlags & ALTADDR)) {
@@ -3413,7 +3413,7 @@ h_stateRestoreHost(struct fs_dump_state * state)
 
     /* for restoring state, we better be able to get a host! */
     host = GetHT();
-    osi_Assert(host != NULL);
+    opr_Assert(host != NULL);
 
     if (ifp) {
        host->interface = ifp;
@@ -3758,112 +3758,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)
@@ -3981,7 +3875,7 @@ CheckHost_r(struct host *host, void *dummy)
 void
 h_CheckHosts(void)
 {
-    afs_uint32 now = FT_ApproxTime();
+    afs_uint32 now = time(NULL);
 
     memset(&zerofid, 0, sizeof(zerofid));
     /*
@@ -4003,7 +3897,7 @@ h_CheckHosts(void)
  *
  * The addresses in the interfaceAddr list are in host byte order.
  */
-int
+static int
 initInterfaceAddr_r(struct host *host, struct interfaceAddr *interf)
 {
     int i, j;
@@ -4016,8 +3910,8 @@ initInterfaceAddr_r(struct host *host, struct interfaceAddr *interf)
     char uuidstr[128];
     afs_uint16 port7001 = htons(7001);
 
-    osi_Assert(host);
-    osi_Assert(interf);
+    opr_Assert(host);
+    opr_Assert(interf);
 
     number = interf->numberOfInterfaces;
     myAddr = host->host;       /* current interface address */
@@ -4123,9 +4017,11 @@ initInterfaceAddr_r(struct host *host, struct interfaceAddr *interf)
 
     interface->uuid = interf->uuid;
 
-    osi_Assert(!host->interface);
+    opr_Assert(!host->interface);
     host->interface = interface;
 
+    h_AddHostToUuidHashTable_r(&interface->uuid, host);
+
     if (LogLevel >= 125) {
        afsUUID_to_string(&interface->uuid, uuidstr, 127);
 
@@ -4154,7 +4050,7 @@ h_DeleteHostFromAddrHashTable_r(afs_uint32 addr, afs_uint16 port,
 
     for (hp = &hostAddrHashTable[h_HashIndex(addr)]; (th = *hp);
         hp = &th->next) {
-        osi_Assert(th->hostPtr);
+        opr_Assert(th->hostPtr);
         if (th->hostPtr == host && th->addr == addr && th->port == port) {
            ViceLog(125, ("h_DeleteHostFromAddrHashTable_r: host %" AFS_PTR_FMT " (%s:%d)\n",
                          host, afs_inet_ntoa_r(host->host, hoststr),