- 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(c, sizeof(*c));
- if (c == NULL)
- RETURN (NULL);
-
- atomic_set(&c->c_refcount, 1);
- c->c_peer = peer;
- c->c_self = self;
- if (uuid != NULL)
- obd_str2uuid(&c->c_remote_uuid, uuid->uuid);
-
- spin_lock(&conn_lock);
-
- c2 = ptlrpc_lookup_conn_locked(peer);
- if (c2 == NULL) {
- list_add(&c->c_link, &conn_list);
- 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;
- }
- }
-
-out_conn:
- spin_unlock(&conn_lock);
+ cfs_atomic_inc(&conn->c_refcount);
+ CDEBUG(D_INFO, "conn=%p refcount %d to %s\n",
+ conn, cfs_atomic_read(&conn->c_refcount),
+ libcfs_nid2str(conn->c_peer.nid));