{
struct server *a_serverP = sa->server;
struct srvAddr *sap;
- osi_timeval_t currTime, *currTimeP; /*Current time */
+ osi_timeval32_t currTime, *currTimeP; /*Current time */
afs_int32 downTime; /*Computed downtime, in seconds */
struct afs_stats_SrvUpDownInfo *upDownP; /*Ptr to up/down info record */
* updated; we'll need them one way or another.
*/
currTimeP = &currTime;
- osi_GetuTime(currTimeP);
+ osi_GetTime(currTimeP);
upDownP = GetUpDownStats(a_serverP);
int currIdx; /*Curr idx into srv table */
struct server *currSrvP; /*Ptr to curr server record */
afs_int32 currChainLen; /*Length of curr hash chain */
- osi_timeval_t currTime; /*Current time */
- osi_timeval_t *currTimeP; /*Ptr to above */
+ osi_timeval32_t currTime; /*Current time */
+ osi_timeval32_t *currTimeP; /*Ptr to above */
afs_int32 srvRecordAge; /*Age of server record, in secs */
struct afs_stats_SrvUpDownInfo *upDownP; /*Ptr to current up/down
* info being manipulated */
* Compute the current time, used to figure out server record ages.
*/
currTimeP = &currTime;
- osi_GetuTime(currTimeP);
+ osi_GetTime(currTimeP);
/*
* Sweep the server hash table, tallying all we need to know.
sa = addrs[i];
ForceNewConnections(sa);
}
+
+ afs_osi_Free(addrs, srvAddrCount * sizeof(*addrs));
}
static void
AFS_STATCNT(afs_random);
if (!state) {
- osi_timeval_t t;
+ osi_timeval32_t t;
osi_GetTime(&t);
/*
- * 0xfffffff0 was changed to (~0 << 4) since it works no matter how many
- * bits are in a tv_usec
+ * Clear the low nybble of tv_usec in a size-independent manner before adding
+ * in the rest of the state.
*/
- state = (t.tv_usec & (~0 << 4)) + (rxi_getaddr() & 0xff);
+ state = t.tv_usec;
+ state ^= (state & 0x0f);
+ state += rxi_getaddr() & 0xff;
state += (t.tv_sec & 0xff);
for (i = 0; i < 30; i++) {
ranstage(state);
#elif defined(AFS_FBSD_ENV)
{
struct in_ifaddr *ifa;
-#if defined(AFS_FBSD80_ENV)
- TAILQ_FOREACH(ifa, &V_in_ifaddrhead, ia_link) {
-#else
- TAILQ_FOREACH(ifa, &in_ifaddrhead, ia_link) {
-#endif
+ CURVNET_SET(rx_socket->so_vnet);
+ TAILQ_FOREACH(ifa, &V_in_ifaddrhead, ia_link) {
afsi_SetServerIPRank(sa, &ifa->ia_ifa);
- }}
+ }
+ CURVNET_RESTORE();
+ }
#elif defined(AFS_OBSD_ENV)
{
extern struct in_ifaddrhead in_ifaddr;
}
/* InitCallBackStateN, triggered by our RPC, may need this */
ReleaseWriteLock(&afs_xserver);
+ AFS_GUNLOCK();
code = RXAFS_GetCapabilities(rxconn, &caps);
+ AFS_GLOCK();
ObtainWriteLock(&afs_xserver, 723);
/* we forced a conn above; important we mark it down if needed */
if ((code < 0) && (code != RXGEN_OPCODE)) {
void
afs_ActivateServer(struct srvAddr *sap)
{
- osi_timeval_t currTime; /*Filled with current time */
- osi_timeval_t *currTimeP; /*Ptr to above */
+ osi_timeval32_t currTime; /*Filled with current time */
+ osi_timeval32_t *currTimeP; /*Ptr to above */
struct afs_stats_SrvUpDownInfo *upDownP; /*Ptr to up/down info record */
struct server *aserver = sap->server;
*/
aserver->flags |= AFS_SERVER_FLAG_ACTIVATED;
currTimeP = &currTime;
- osi_GetuTime(currTimeP);
+ osi_GetTime(currTimeP);
aserver->activationTime = currTime.tv_sec;
upDownP = GetUpDownStats(aserver);
if (aserver->flags & SRVR_ISDOWN) {