- CDEBUG(D_INFO, "self %s peer %s\n",
- libcfs_nid2str(self), libcfs_id2str(peer));
-
- spin_lock(&conn_lock);
- c = ptlrpc_lookup_conn_locked(peer);
- spin_unlock(&conn_lock);
-
- if (c != NULL)
- RETURN (c);
-
- OBD_ALLOC_PTR(c);
- if (c == NULL)
- RETURN (NULL);
-
- atomic_set(&c->c_refcount, 1);
- c->c_peer = peer;
- c->c_self = self;
- INIT_HLIST_NODE(&c->c_hash);
- CFS_INIT_LIST_HEAD(&c->c_link);
- if (uuid != NULL)
- obd_str2uuid(&c->c_remote_uuid, uuid->uuid);
-
- spin_lock(&conn_lock);
-
- c2 = ptlrpc_lookup_conn_locked(peer);
- if (c2 == NULL) {
- rc = lustre_hash_additem_unique(conn_hash_body, &peer,
- &c->c_hash);
- if (rc != 0) {
- CERROR("Cannot add connection to conn_hash_body\n");
- goto out_conn;
- }
- list_add(&c->c_link, &conn_list);
- }
-
-out_conn:
- spin_unlock(&conn_lock);
-
- if (c2 == NULL && rc == 0)
- RETURN (c);
-
- if (c != NULL)
- OBD_FREE(c, sizeof(*c));
- RETURN (c2);
+ conn_hash = lustre_hash_init("CONN_HASH", 5, 15,
+ &conn_hash_ops, LH_REHASH);
+ if (!conn_hash)
+ RETURN(-ENOMEM);
+
+ RETURN(0);