Lines Matching defs:cr

78 	struct iscsi_conn_recovery *cr)
81 list_add_tail(&cr->cr_list, &sess->cr_active_list);
89 struct iscsi_conn_recovery *cr)
92 list_add_tail(&cr->cr_list, &sess->cr_inactive_list);
106 struct iscsi_conn_recovery *cr;
109 list_for_each_entry(cr, &sess->cr_inactive_list, cr_list) {
110 if (cr->cid == cid) {
112 return cr;
123 struct iscsi_conn_recovery *cr, *cr_tmp;
126 list_for_each_entry_safe(cr, cr_tmp, &sess->cr_active_list, cr_list) {
127 list_del(&cr->cr_list);
130 spin_lock(&cr->conn_recovery_cmd_lock);
132 &cr->conn_recovery_cmd_list, i_conn_node) {
136 spin_unlock(&cr->conn_recovery_cmd_lock);
138 spin_lock(&cr->conn_recovery_cmd_lock);
140 spin_unlock(&cr->conn_recovery_cmd_lock);
143 kfree(cr);
148 list_for_each_entry_safe(cr, cr_tmp, &sess->cr_inactive_list, cr_list) {
149 list_del(&cr->cr_list);
152 spin_lock(&cr->conn_recovery_cmd_lock);
154 &cr->conn_recovery_cmd_list, i_conn_node) {
158 spin_unlock(&cr->conn_recovery_cmd_lock);
160 spin_lock(&cr->conn_recovery_cmd_lock);
162 spin_unlock(&cr->conn_recovery_cmd_lock);
165 kfree(cr);
171 struct iscsi_conn_recovery *cr,
175 list_del(&cr->cr_list);
182 kfree(cr);
188 struct iscsi_conn_recovery *cr,
192 list_del(&cr->cr_list);
197 * Called with cr->conn_recovery_cmd_lock help.
203 struct iscsi_conn_recovery *cr;
205 if (!cmd->cr) {
210 cr = cmd->cr;
213 return --cr->cmd_count;
217 struct iscsi_conn_recovery *cr,
222 struct iscsit_session *sess = cr->sess;
224 spin_lock(&cr->conn_recovery_cmd_lock);
226 &cr->conn_recovery_cmd_list, i_conn_node) {
237 cmd->stat_sn, cr->cid);
241 spin_unlock(&cr->conn_recovery_cmd_lock);
243 spin_lock(&cr->conn_recovery_cmd_lock);
245 spin_unlock(&cr->conn_recovery_cmd_lock);
249 dropped_count, cr->cid, exp_statsn);
251 if (!cr->cmd_count) {
254 cr->cid, sess->sid);
255 iscsit_remove_inactive_connection_recovery_entry(cr, sess);
256 iscsit_attach_active_connection_recovery_entry(sess, cr);
258 " %hu on SID: %u\n", cr->cid, sess->sid);
259 iscsit_remove_active_connection_recovery_entry(cr, sess);
261 iscsit_remove_inactive_connection_recovery_entry(cr, sess);
262 iscsit_attach_active_connection_recovery_entry(sess, cr);
311 struct iscsi_conn_recovery *cr;
316 * (struct iscsit_cmd->cr) so we need to allocate this before preparing the
319 cr = kzalloc(sizeof(struct iscsi_conn_recovery), GFP_KERNEL);
320 if (!cr) {
325 INIT_LIST_HEAD(&cr->cr_list);
326 INIT_LIST_HEAD(&cr->conn_recovery_cmd_list);
327 spin_lock_init(&cr->conn_recovery_cmd_lock);
398 spin_lock(&cr->conn_recovery_cmd_lock);
399 list_add_tail(&cmd->i_conn_node, &cr->conn_recovery_cmd_list);
400 spin_unlock(&cr->conn_recovery_cmd_lock);
403 cmd->cr = cr;
410 cr->cid = conn->cid;
411 cr->cmd_count = cmd_count;
412 cr->maxrecvdatasegmentlength = conn->conn_ops->MaxRecvDataSegmentLength;
413 cr->maxxmitdatasegmentlength = conn->conn_ops->MaxXmitDataSegmentLength;
414 cr->sess = conn->sess;
416 iscsit_attach_inactive_connection_recovery_entry(conn->sess, cr);