/*
* Allocate a host. It will be identified by the peer (ip,port) info in the
- * rx connection provided. The host is returned un-held and un-locked
+ * rx connection provided. The host is returned held and locked
*/
#define DEF_ROPCONS 2115
-struct host *h_Alloc(register struct rx_connection *r_con)
-{
- struct host *retVal;
- H_LOCK
- retVal = h_Alloc_r(r_con);
- H_UNLOCK
- return retVal;
-}
-
struct host *h_Alloc_r(register struct rx_connection *r_con)
{
register int code;
h_gethostcps(host); /* do this under host lock */
#endif
host->FirstClient = 0;
+ h_Hold_r(host);
+ h_Lock_r(host);
h_InsertList_r(host); /* update global host List */
#if FS_STATS_DETAILED
/*
#endif /* FS_STATS_DETAILED */
return host;
-} /*h_Alloc*/
+} /*h_Alloc_r*/
/* Lookup a host given an IP address and UDP port number. */
goto retry;
}
} else {
- host = h_Alloc_r(tcon);
- h_Hold_r(host);
- h_Lock_r(host);
+ host = h_Alloc_r(tcon); /* returned held and locked */
h_gethostcps_r(host,FT_ApproxTime());
if (!(host->Console&1)) {
if (!identP || !interfValid) {