Lines Matching refs:dr
30 struct iscsi_datain_req *dr; in iscsit_allocate_datain_req() local
32 dr = kmem_cache_zalloc(lio_dr_cache, GFP_ATOMIC); in iscsit_allocate_datain_req()
33 if (!dr) { in iscsit_allocate_datain_req()
38 INIT_LIST_HEAD(&dr->cmd_datain_node); in iscsit_allocate_datain_req()
40 return dr; in iscsit_allocate_datain_req()
43 void iscsit_attach_datain_req(struct iscsi_cmd *cmd, struct iscsi_datain_req *dr) in iscsit_attach_datain_req() argument
46 list_add_tail(&dr->cmd_datain_node, &cmd->datain_list); in iscsit_attach_datain_req()
50 void iscsit_free_datain_req(struct iscsi_cmd *cmd, struct iscsi_datain_req *dr) in iscsit_free_datain_req() argument
53 list_del(&dr->cmd_datain_node); in iscsit_free_datain_req()
56 kmem_cache_free(lio_dr_cache, dr); in iscsit_free_datain_req()
61 struct iscsi_datain_req *dr, *dr_tmp; in iscsit_free_all_datain_reqs() local
64 list_for_each_entry_safe(dr, dr_tmp, &cmd->datain_list, cmd_datain_node) { in iscsit_free_all_datain_reqs()
65 list_del(&dr->cmd_datain_node); in iscsit_free_all_datain_reqs()
66 kmem_cache_free(lio_dr_cache, dr); in iscsit_free_all_datain_reqs()
92 struct iscsi_datain_req *dr; in iscsit_set_datain_values_yes_and_yes() local
94 dr = iscsit_get_datain_req(cmd); in iscsit_set_datain_values_yes_and_yes()
95 if (!dr) in iscsit_set_datain_values_yes_and_yes()
98 if (dr->recovery && dr->generate_recovery_values) { in iscsit_set_datain_values_yes_and_yes()
100 cmd, dr) < 0) in iscsit_set_datain_values_yes_and_yes()
103 dr->generate_recovery_values = 0; in iscsit_set_datain_values_yes_and_yes()
106 next_burst_len = (!dr->recovery) ? in iscsit_set_datain_values_yes_and_yes()
107 cmd->next_burst_len : dr->next_burst_len; in iscsit_set_datain_values_yes_and_yes()
108 read_data_done = (!dr->recovery) ? in iscsit_set_datain_values_yes_and_yes()
109 cmd->read_data_done : dr->read_data_done; in iscsit_set_datain_values_yes_and_yes()
144 datain->data_sn = (!dr->recovery) ? cmd->data_sn++ : dr->data_sn++; in iscsit_set_datain_values_yes_and_yes()
147 if (!dr->recovery) { in iscsit_set_datain_values_yes_and_yes()
151 dr->next_burst_len = next_burst_len; in iscsit_set_datain_values_yes_and_yes()
152 dr->read_data_done += datain->length; in iscsit_set_datain_values_yes_and_yes()
155 if (!dr->recovery) { in iscsit_set_datain_values_yes_and_yes()
157 dr->dr_complete = DATAIN_COMPLETE_NORMAL; in iscsit_set_datain_values_yes_and_yes()
159 return dr; in iscsit_set_datain_values_yes_and_yes()
162 if (!dr->runlength) { in iscsit_set_datain_values_yes_and_yes()
164 dr->dr_complete = in iscsit_set_datain_values_yes_and_yes()
165 (dr->recovery == DATAIN_WITHIN_COMMAND_RECOVERY) ? in iscsit_set_datain_values_yes_and_yes()
170 if ((dr->begrun + dr->runlength) == dr->data_sn) { in iscsit_set_datain_values_yes_and_yes()
171 dr->dr_complete = in iscsit_set_datain_values_yes_and_yes()
172 (dr->recovery == DATAIN_WITHIN_COMMAND_RECOVERY) ? in iscsit_set_datain_values_yes_and_yes()
178 return dr; in iscsit_set_datain_values_yes_and_yes()
190 struct iscsi_datain_req *dr; in iscsit_set_datain_values_no_and_yes() local
193 dr = iscsit_get_datain_req(cmd); in iscsit_set_datain_values_no_and_yes()
194 if (!dr) in iscsit_set_datain_values_no_and_yes()
197 if (dr->recovery && dr->generate_recovery_values) { in iscsit_set_datain_values_no_and_yes()
199 cmd, dr) < 0) in iscsit_set_datain_values_no_and_yes()
202 dr->generate_recovery_values = 0; in iscsit_set_datain_values_no_and_yes()
205 read_data_done = (!dr->recovery) ? in iscsit_set_datain_values_no_and_yes()
206 cmd->read_data_done : dr->read_data_done; in iscsit_set_datain_values_no_and_yes()
207 seq_send_order = (!dr->recovery) ? in iscsit_set_datain_values_no_and_yes()
208 cmd->seq_send_order : dr->seq_send_order; in iscsit_set_datain_values_no_and_yes()
223 if (!dr->recovery && !seq->next_burst_len) in iscsit_set_datain_values_no_and_yes()
265 datain->data_sn = (!dr->recovery) ? cmd->data_sn++ : dr->data_sn++; in iscsit_set_datain_values_no_and_yes()
266 if (!dr->recovery) { in iscsit_set_datain_values_no_and_yes()
270 dr->seq_send_order = seq_send_order; in iscsit_set_datain_values_no_and_yes()
271 dr->read_data_done += datain->length; in iscsit_set_datain_values_no_and_yes()
274 if (!dr->recovery) { in iscsit_set_datain_values_no_and_yes()
278 dr->dr_complete = DATAIN_COMPLETE_NORMAL; in iscsit_set_datain_values_no_and_yes()
280 return dr; in iscsit_set_datain_values_no_and_yes()
283 if (!dr->runlength) { in iscsit_set_datain_values_no_and_yes()
285 dr->dr_complete = in iscsit_set_datain_values_no_and_yes()
286 (dr->recovery == DATAIN_WITHIN_COMMAND_RECOVERY) ? in iscsit_set_datain_values_no_and_yes()
291 if ((dr->begrun + dr->runlength) == dr->data_sn) { in iscsit_set_datain_values_no_and_yes()
292 dr->dr_complete = in iscsit_set_datain_values_no_and_yes()
293 (dr->recovery == DATAIN_WITHIN_COMMAND_RECOVERY) ? in iscsit_set_datain_values_no_and_yes()
299 return dr; in iscsit_set_datain_values_no_and_yes()
311 struct iscsi_datain_req *dr; in iscsit_set_datain_values_yes_and_no() local
314 dr = iscsit_get_datain_req(cmd); in iscsit_set_datain_values_yes_and_no()
315 if (!dr) in iscsit_set_datain_values_yes_and_no()
318 if (dr->recovery && dr->generate_recovery_values) { in iscsit_set_datain_values_yes_and_no()
320 cmd, dr) < 0) in iscsit_set_datain_values_yes_and_no()
323 dr->generate_recovery_values = 0; in iscsit_set_datain_values_yes_and_no()
326 next_burst_len = (!dr->recovery) ? in iscsit_set_datain_values_yes_and_no()
327 cmd->next_burst_len : dr->next_burst_len; in iscsit_set_datain_values_yes_and_no()
328 read_data_done = (!dr->recovery) ? in iscsit_set_datain_values_yes_and_no()
329 cmd->read_data_done : dr->read_data_done; in iscsit_set_datain_values_yes_and_no()
335 return dr; in iscsit_set_datain_values_yes_and_no()
340 return dr; in iscsit_set_datain_values_yes_and_no()
361 pdu->data_sn = (!dr->recovery) ? cmd->data_sn++ : dr->data_sn++; in iscsit_set_datain_values_yes_and_no()
362 if (!dr->recovery) { in iscsit_set_datain_values_yes_and_no()
366 dr->next_burst_len = next_burst_len; in iscsit_set_datain_values_yes_and_no()
367 dr->read_data_done += pdu->length; in iscsit_set_datain_values_yes_and_no()
375 if (!dr->recovery) { in iscsit_set_datain_values_yes_and_no()
377 dr->dr_complete = DATAIN_COMPLETE_NORMAL; in iscsit_set_datain_values_yes_and_no()
379 return dr; in iscsit_set_datain_values_yes_and_no()
382 if (!dr->runlength) { in iscsit_set_datain_values_yes_and_no()
384 dr->dr_complete = in iscsit_set_datain_values_yes_and_no()
385 (dr->recovery == DATAIN_WITHIN_COMMAND_RECOVERY) ? in iscsit_set_datain_values_yes_and_no()
390 if ((dr->begrun + dr->runlength) == dr->data_sn) { in iscsit_set_datain_values_yes_and_no()
391 dr->dr_complete = in iscsit_set_datain_values_yes_and_no()
392 (dr->recovery == DATAIN_WITHIN_COMMAND_RECOVERY) ? in iscsit_set_datain_values_yes_and_no()
398 return dr; in iscsit_set_datain_values_yes_and_no()
410 struct iscsi_datain_req *dr; in iscsit_set_datain_values_no_and_no() local
414 dr = iscsit_get_datain_req(cmd); in iscsit_set_datain_values_no_and_no()
415 if (!dr) in iscsit_set_datain_values_no_and_no()
418 if (dr->recovery && dr->generate_recovery_values) { in iscsit_set_datain_values_no_and_no()
420 cmd, dr) < 0) in iscsit_set_datain_values_no_and_no()
423 dr->generate_recovery_values = 0; in iscsit_set_datain_values_no_and_no()
426 read_data_done = (!dr->recovery) ? in iscsit_set_datain_values_no_and_no()
427 cmd->read_data_done : dr->read_data_done; in iscsit_set_datain_values_no_and_no()
428 seq_send_order = (!dr->recovery) ? in iscsit_set_datain_values_no_and_no()
429 cmd->seq_send_order : dr->seq_send_order; in iscsit_set_datain_values_no_and_no()
444 if (!dr->recovery && !seq->next_burst_len) in iscsit_set_datain_values_no_and_no()
464 pdu->data_sn = (!dr->recovery) ? cmd->data_sn++ : dr->data_sn++; in iscsit_set_datain_values_no_and_no()
465 if (!dr->recovery) { in iscsit_set_datain_values_no_and_no()
469 dr->seq_send_order = seq_send_order; in iscsit_set_datain_values_no_and_no()
470 dr->read_data_done += pdu->length; in iscsit_set_datain_values_no_and_no()
478 if (!dr->recovery) { in iscsit_set_datain_values_no_and_no()
482 dr->dr_complete = DATAIN_COMPLETE_NORMAL; in iscsit_set_datain_values_no_and_no()
484 return dr; in iscsit_set_datain_values_no_and_no()
487 if (!dr->runlength) { in iscsit_set_datain_values_no_and_no()
489 dr->dr_complete = in iscsit_set_datain_values_no_and_no()
490 (dr->recovery == DATAIN_WITHIN_COMMAND_RECOVERY) ? in iscsit_set_datain_values_no_and_no()
495 if ((dr->begrun + dr->runlength) == dr->data_sn) { in iscsit_set_datain_values_no_and_no()
496 dr->dr_complete = in iscsit_set_datain_values_no_and_no()
497 (dr->recovery == DATAIN_WITHIN_COMMAND_RECOVERY) ? in iscsit_set_datain_values_no_and_no()
503 return dr; in iscsit_set_datain_values_no_and_no()