void isert_free_connection(struct iscsi_conn *iscsi_conn) { struct isert_connection *isert_conn = container_of(iscsi_conn, struct isert_connection, iscsi); isert_post_drain(isert_conn); isert_conn_free(isert_conn); }
static int isert_cm_connect_handler(struct rdma_cm_id *cm_id, struct rdma_cm_event *event) { struct isert_connection *isert_conn = cm_id->qp->qp_context; int push_saved_pdu = 0; int ret; TRACE_ENTRY(); if (isert_conn->state == ISER_CONN_HANDSHAKE) isert_conn->state = ISER_CONN_ACTIVE; else if (isert_conn->state == ISER_CONN_ACTIVE) push_saved_pdu = 1; ret = isert_get_addr_size((struct sockaddr *)&isert_conn->peer_addr, &isert_conn->peer_addrsz); if (unlikely(ret)) goto out; kref_get(&isert_conn->kref); /* notify upper layer */ ret = isert_conn_established(&isert_conn->iscsi, (struct sockaddr *)&isert_conn->peer_addr, isert_conn->peer_addrsz); if (unlikely(ret)) { set_bit(ISERT_CONNECTION_ABORTED, &isert_conn->flags); isert_post_drain(isert_conn); isert_conn_free(isert_conn); goto out; } if (push_saved_pdu) { pr_info("iser push saved rx pdu\n"); isert_recv_completion_handler(isert_conn->saved_wr); isert_conn->saved_wr = NULL; } out: TRACE_EXIT_RES(ret); return ret; }