void isert_release_tx_pdu(struct iscsi_cmnd *iscsi_pdu) { struct isert_cmnd *isert_pdu = container_of(iscsi_pdu, struct isert_cmnd, iscsi); struct isert_connection *isert_conn = container_of(iscsi_pdu->conn, struct isert_connection, iscsi); isert_tx_pdu_init_iscsi(isert_pdu); spin_lock(&isert_conn->tx_lock); list_move(&isert_pdu->pool_node, &isert_conn->tx_free_list); spin_unlock(&isert_conn->tx_lock); }
/* tx pdu should set most of the pointers to enable filling out * of the iscsi pdu struct */ void isert_tx_pdu_init(struct isert_cmnd *isert_pdu, struct isert_connection *isert_conn) { struct iscsi_cmnd *iscsi_cmnd = &isert_pdu->iscsi; struct isert_buf *isert_buf = &isert_pdu->buf; void *addr = isert_buf->addr; struct iscsi_hdr *bhs = (struct iscsi_hdr *)(addr + sizeof(struct isert_hdr)); isert_pdu->isert_hdr = (struct isert_hdr *)addr; isert_pdu->bhs = bhs; isert_pdu->ahs = NULL; isert_tx_pdu_init_iscsi(isert_pdu); iscsi_cmnd->conn = &isert_conn->iscsi; }