Lines Matching refs:tcp_conn
1118 struct connection *tcp_conn = NULL;
1121 list_for_each_entry(tcp_conn, &node->conn_impl_list, list) {
1122 if (tcp_conn->connect_handle) {
1123 tcp = (struct tcp_handle *)(tcp_conn->connect_handle);
1125 connection_get(tcp_conn);
1126 return tcp_conn;
1145 struct connection *tcp_conn = NULL;
1148 tcp_conn = kzalloc(sizeof(*tcp_conn), GFP_KERNEL);
1149 if (!tcp_conn)
1152 kref_init(&tcp_conn->ref_cnt);
1153 mutex_init(&tcp_conn->ref_lock);
1154 INIT_LIST_HEAD(&tcp_conn->list);
1155 tcp_conn->node = node;
1156 tcp_conn->close = tcp_stop_connect;
1157 tcp_conn->send_message = tcp_send_message;
1158 tcp_conn->type = CONNECT_TYPE_TCP;
1159 tcp_conn->status = status;
1160 tcp_conn->stat.rekey_time = nowtime;
1161 tcp_conn->connect_handle =
1162 (void *)tcp_alloc_handle(tcp_conn, socket_fd, master_key, socket);
1163 INIT_WORK(&tcp_conn->reget_work, hmdfs_reget_connection_work_fn);
1164 if (!tcp_conn->connect_handle) {
1168 return tcp_conn;
1171 kfree(tcp_conn);
1199 struct connection *tcp_conn = NULL, *on_peer_conn = NULL;
1210 tcp_conn = lookup_conn_by_socketfd_unsafe(node, socket);
1212 if (tcp_conn) {
1219 tcp_conn = alloc_conn_tcp(node, fd, master_key, status, socket);
1220 if (!tcp_conn) {
1227 on_peer_conn = add_conn_tcp_unsafe(node, socket, tcp_conn);
1229 tcp = tcp_conn->connect_handle;
1230 if (on_peer_conn == tcp_conn) {
1241 connection_put(tcp_conn);
1243 tcp_conn = on_peer_conn;
1247 return tcp_conn;