Lines Matching refs:task
146 void iscsi_prep_data_out_pdu(struct iscsi_task *task, struct iscsi_r2t_info *r2t, in iscsi_prep_data_out_pdu() argument
149 struct iscsi_conn *conn = task->conn; in iscsi_prep_data_out_pdu()
152 task->hdr_len = sizeof(struct iscsi_data); in iscsi_prep_data_out_pdu()
159 hdr->lun = task->lun; in iscsi_prep_data_out_pdu()
160 hdr->itt = task->hdr_itt; in iscsi_prep_data_out_pdu()
176 static int iscsi_add_hdr(struct iscsi_task *task, unsigned len) in iscsi_add_hdr() argument
178 unsigned exp_len = task->hdr_len + len; in iscsi_add_hdr()
180 if (exp_len > task->hdr_max) { in iscsi_add_hdr()
186 task->hdr_len = exp_len; in iscsi_add_hdr()
193 static int iscsi_prep_ecdb_ahs(struct iscsi_task *task) in iscsi_prep_ecdb_ahs() argument
195 struct scsi_cmnd *cmd = task->sc; in iscsi_prep_ecdb_ahs()
201 ecdb_ahdr = iscsi_next_hdr(task); in iscsi_prep_ecdb_ahs()
209 rc = iscsi_add_hdr(task, sizeof(ecdb_ahdr->ahslength) + in iscsi_prep_ecdb_ahs()
222 ISCSI_DBG_SESSION(task->conn->session, in iscsi_prep_ecdb_ahs()
226 task->hdr_len); in iscsi_prep_ecdb_ahs()
243 static int iscsi_check_tmf_restrictions(struct iscsi_task *task, int opcode) in iscsi_check_tmf_restrictions() argument
245 struct iscsi_session *session = task->conn->session; in iscsi_check_tmf_restrictions()
261 if (hdr_lun != task->sc->device->lun) in iscsi_check_tmf_restrictions()
271 opcode, task->itt, task->hdr_itt); in iscsi_check_tmf_restrictions()
281 opcode, task->itt, task->hdr_itt); in iscsi_check_tmf_restrictions()
293 task->hdr_itt == tmf->rtt) { in iscsi_check_tmf_restrictions()
297 "progress\n", task->itt, in iscsi_check_tmf_restrictions()
298 task->hdr_itt); in iscsi_check_tmf_restrictions()
314 static int iscsi_prep_scsi_cmd_pdu(struct iscsi_task *task) in iscsi_prep_scsi_cmd_pdu() argument
316 struct iscsi_conn *conn = task->conn; in iscsi_prep_scsi_cmd_pdu()
318 struct scsi_cmnd *sc = task->sc; in iscsi_prep_scsi_cmd_pdu()
324 rc = iscsi_check_tmf_restrictions(task, ISCSI_OP_SCSI_CMD); in iscsi_prep_scsi_cmd_pdu()
329 rc = conn->session->tt->alloc_pdu(task, ISCSI_OP_SCSI_CMD); in iscsi_prep_scsi_cmd_pdu()
333 hdr = (struct iscsi_scsi_req *)task->hdr; in iscsi_prep_scsi_cmd_pdu()
338 hdr->itt = task->hdr_itt = itt; in iscsi_prep_scsi_cmd_pdu()
340 hdr->itt = task->hdr_itt = build_itt(task->itt, in iscsi_prep_scsi_cmd_pdu()
341 task->conn->session->age); in iscsi_prep_scsi_cmd_pdu()
342 task->hdr_len = 0; in iscsi_prep_scsi_cmd_pdu()
343 rc = iscsi_add_hdr(task, sizeof(*hdr)); in iscsi_prep_scsi_cmd_pdu()
349 task->lun = hdr->lun; in iscsi_prep_scsi_cmd_pdu()
355 rc = iscsi_prep_ecdb_ahs(task); in iscsi_prep_scsi_cmd_pdu()
362 task->imm_count = 0; in iscsi_prep_scsi_cmd_pdu()
364 task->protected = true; in iscsi_prep_scsi_cmd_pdu()
369 struct iscsi_r2t_info *r2t = &task->unsol_r2t; in iscsi_prep_scsi_cmd_pdu()
390 task->imm_count = min(session->first_burst, in iscsi_prep_scsi_cmd_pdu()
393 task->imm_count = min(transfer_length, in iscsi_prep_scsi_cmd_pdu()
395 hton24(hdr->dlength, task->imm_count); in iscsi_prep_scsi_cmd_pdu()
402 task->imm_count; in iscsi_prep_scsi_cmd_pdu()
403 r2t->data_offset = task->imm_count; in iscsi_prep_scsi_cmd_pdu()
408 if (!task->unsol_r2t.data_length) in iscsi_prep_scsi_cmd_pdu()
420 hdrlength = task->hdr_len - sizeof(*hdr); in iscsi_prep_scsi_cmd_pdu()
427 hdr->cmdsn = task->cmdsn = cpu_to_be32(session->cmdsn); in iscsi_prep_scsi_cmd_pdu()
429 if (session->tt->init_task && session->tt->init_task(task)) in iscsi_prep_scsi_cmd_pdu()
432 task->state = ISCSI_TASK_RUNNING; in iscsi_prep_scsi_cmd_pdu()
440 task->itt, transfer_length, in iscsi_prep_scsi_cmd_pdu()
454 static void iscsi_free_task(struct iscsi_task *task) in iscsi_free_task() argument
456 struct iscsi_conn *conn = task->conn; in iscsi_free_task()
458 struct scsi_cmnd *sc = task->sc; in iscsi_free_task()
459 int oldstate = task->state; in iscsi_free_task()
462 task->itt, task->state, task->sc); in iscsi_free_task()
464 session->tt->cleanup_task(task); in iscsi_free_task()
465 task->state = ISCSI_TASK_FREE; in iscsi_free_task()
466 task->sc = NULL; in iscsi_free_task()
470 if (conn->login_task == task) in iscsi_free_task()
473 kfifo_in(&session->cmdpool.queue, (void*)&task, sizeof(void*)); in iscsi_free_task()
477 iscsi_cmd(sc)->task = NULL; in iscsi_free_task()
487 bool iscsi_get_task(struct iscsi_task *task) in iscsi_get_task() argument
489 return refcount_inc_not_zero(&task->refcount); in iscsi_get_task()
499 void __iscsi_put_task(struct iscsi_task *task) in __iscsi_put_task() argument
501 if (refcount_dec_and_test(&task->refcount)) in __iscsi_put_task()
502 iscsi_free_task(task); in __iscsi_put_task()
506 void iscsi_put_task(struct iscsi_task *task) in iscsi_put_task() argument
508 struct iscsi_session *session = task->conn->session; in iscsi_put_task()
510 if (refcount_dec_and_test(&task->refcount)) { in iscsi_put_task()
512 iscsi_free_task(task); in iscsi_put_task()
525 static void iscsi_complete_task(struct iscsi_task *task, int state) in iscsi_complete_task() argument
527 struct iscsi_conn *conn = task->conn; in iscsi_complete_task()
531 task->itt, task->state, task->sc); in iscsi_complete_task()
532 if (task->state == ISCSI_TASK_COMPLETED || in iscsi_complete_task()
533 task->state == ISCSI_TASK_ABRT_TMF || in iscsi_complete_task()
534 task->state == ISCSI_TASK_ABRT_SESS_RECOV || in iscsi_complete_task()
535 task->state == ISCSI_TASK_REQUEUE_SCSIQ) in iscsi_complete_task()
537 WARN_ON_ONCE(task->state == ISCSI_TASK_FREE); in iscsi_complete_task()
538 task->state = state; in iscsi_complete_task()
540 if (READ_ONCE(conn->ping_task) == task) in iscsi_complete_task()
544 __iscsi_put_task(task); in iscsi_complete_task()
558 void iscsi_complete_scsi_task(struct iscsi_task *task, in iscsi_complete_scsi_task() argument
561 struct iscsi_conn *conn = task->conn; in iscsi_complete_scsi_task()
563 ISCSI_DBG_SESSION(conn->session, "[itt 0x%x]\n", task->itt); in iscsi_complete_scsi_task()
567 iscsi_complete_task(task, ISCSI_TASK_COMPLETED); in iscsi_complete_scsi_task()
574 static bool cleanup_queued_task(struct iscsi_task *task) in cleanup_queued_task() argument
576 struct iscsi_conn *conn = task->conn; in cleanup_queued_task()
584 if (task->state == ISCSI_TASK_COMPLETED) in cleanup_queued_task()
587 if (!list_empty(&task->running)) { in cleanup_queued_task()
588 list_del_init(&task->running); in cleanup_queued_task()
593 if (task->state == ISCSI_TASK_RUNNING || in cleanup_queued_task()
594 task->state == ISCSI_TASK_COMPLETED) in cleanup_queued_task()
595 __iscsi_put_task(task); in cleanup_queued_task()
598 if (conn->session->running_aborted_task == task) { in cleanup_queued_task()
600 __iscsi_put_task(task); in cleanup_queued_task()
603 if (conn->task == task) { in cleanup_queued_task()
604 conn->task = NULL; in cleanup_queued_task()
605 __iscsi_put_task(task); in cleanup_queued_task()
615 static void __fail_scsi_task(struct iscsi_task *task, int err) in __fail_scsi_task() argument
617 struct iscsi_conn *conn = task->conn; in __fail_scsi_task()
621 if (cleanup_queued_task(task)) in __fail_scsi_task()
624 if (task->state == ISCSI_TASK_PENDING) { in __fail_scsi_task()
637 sc = task->sc; in __fail_scsi_task()
640 iscsi_complete_task(task, state); in __fail_scsi_task()
643 static void fail_scsi_task(struct iscsi_task *task, int err) in fail_scsi_task() argument
645 struct iscsi_session *session = task->conn->session; in fail_scsi_task()
648 __fail_scsi_task(task, err); in fail_scsi_task()
653 struct iscsi_task *task) in iscsi_prep_mgmt_task() argument
656 struct iscsi_hdr *hdr = task->hdr; in iscsi_prep_mgmt_task()
685 if (session->tt->init_task && session->tt->init_task(task)) in iscsi_prep_mgmt_task()
691 task->state = ISCSI_TASK_RUNNING; in iscsi_prep_mgmt_task()
694 hdr->itt, task->data_count); in iscsi_prep_mgmt_task()
711 struct iscsi_task *task; in iscsi_alloc_mgmt_task() local
736 task = conn->login_task; in iscsi_alloc_mgmt_task()
750 (void*)&task, sizeof(void*))) in iscsi_alloc_mgmt_task()
758 refcount_set(&task->refcount, 1); in iscsi_alloc_mgmt_task()
759 task->conn = conn; in iscsi_alloc_mgmt_task()
760 task->sc = NULL; in iscsi_alloc_mgmt_task()
761 INIT_LIST_HEAD(&task->running); in iscsi_alloc_mgmt_task()
762 task->state = ISCSI_TASK_PENDING; in iscsi_alloc_mgmt_task()
765 memcpy(task->data, data, data_size); in iscsi_alloc_mgmt_task()
766 task->data_count = data_size; in iscsi_alloc_mgmt_task()
768 task->data_count = 0; in iscsi_alloc_mgmt_task()
771 if (conn->session->tt->alloc_pdu(task, hdr->opcode)) { in iscsi_alloc_mgmt_task()
778 itt = task->hdr->itt; in iscsi_alloc_mgmt_task()
779 task->hdr_len = sizeof(struct iscsi_hdr); in iscsi_alloc_mgmt_task()
780 memcpy(task->hdr, hdr, sizeof(struct iscsi_hdr)); in iscsi_alloc_mgmt_task()
784 task->hdr->itt = itt; in iscsi_alloc_mgmt_task()
786 task->hdr->itt = build_itt(task->itt, in iscsi_alloc_mgmt_task()
787 task->conn->session->age); in iscsi_alloc_mgmt_task()
790 return task; in iscsi_alloc_mgmt_task()
793 iscsi_put_task(task); in iscsi_alloc_mgmt_task()
804 static int iscsi_send_mgmt_task(struct iscsi_task *task) in iscsi_send_mgmt_task() argument
806 struct iscsi_conn *conn = task->conn; in iscsi_send_mgmt_task()
812 rc = iscsi_prep_mgmt_task(conn, task); in iscsi_send_mgmt_task()
816 rc = session->tt->xmit_task(task); in iscsi_send_mgmt_task()
820 list_add_tail(&task->running, &conn->mgmtqueue); in iscsi_send_mgmt_task()
830 struct iscsi_task *task; in __iscsi_conn_send_pdu() local
833 task = iscsi_alloc_mgmt_task(conn, hdr, data, data_size); in __iscsi_conn_send_pdu()
834 if (!task) in __iscsi_conn_send_pdu()
837 rc = iscsi_send_mgmt_task(task); in __iscsi_conn_send_pdu()
839 iscsi_put_task(task); in __iscsi_conn_send_pdu()
870 struct iscsi_task *task, char *data, in iscsi_scsi_cmd_rsp() argument
875 struct scsi_cmnd *sc = task->sc; in iscsi_scsi_cmd_rsp()
882 if (task->protected) { in iscsi_scsi_cmd_rsp()
893 ascq = session->tt->check_protection(task, §or); in iscsi_scsi_cmd_rsp()
950 sc, sc->result, task->itt); in iscsi_scsi_cmd_rsp()
952 iscsi_complete_task(task, ISCSI_TASK_COMPLETED); in iscsi_scsi_cmd_rsp()
966 struct iscsi_task *task) in iscsi_data_in_rsp() argument
969 struct scsi_cmnd *sc = task->sc; in iscsi_data_in_rsp()
991 sc, sc->result, task->itt); in iscsi_data_in_rsp()
993 iscsi_complete_task(task, ISCSI_TASK_COMPLETED); in iscsi_data_in_rsp()
1019 struct iscsi_task *task; in iscsi_send_nopout() local
1037 task = iscsi_alloc_mgmt_task(conn, (struct iscsi_hdr *)&hdr, NULL, 0); in iscsi_send_nopout()
1038 if (!task) in iscsi_send_nopout()
1042 WRITE_ONCE(conn->ping_task, task); in iscsi_send_nopout()
1044 if (iscsi_send_mgmt_task(task)) { in iscsi_send_nopout()
1047 iscsi_put_task(task); in iscsi_send_nopout()
1069 static int iscsi_nop_out_rsp(struct iscsi_task *task, in iscsi_nop_out_rsp() argument
1072 struct iscsi_conn *conn = task->conn; in iscsi_nop_out_rsp()
1075 if (READ_ONCE(conn->ping_task) != task) { in iscsi_nop_out_rsp()
1085 iscsi_complete_task(task, ISCSI_TASK_COMPLETED); in iscsi_nop_out_rsp()
1145 struct iscsi_task *task; in iscsi_handle_reject() local
1150 task = iscsi_itt_to_task(conn, rejected_pdu.itt); in iscsi_handle_reject()
1151 if (!task) { in iscsi_handle_reject()
1157 rc = iscsi_nop_out_rsp(task, in iscsi_handle_reject()
1217 struct iscsi_task *task; in __iscsi_complete_pdu() local
1271 task = iscsi_itt_to_ctask(conn, hdr->itt); in __iscsi_complete_pdu()
1272 if (!task) in __iscsi_complete_pdu()
1274 task->last_xfer = jiffies; in __iscsi_complete_pdu()
1286 task = iscsi_itt_to_task(conn, hdr->itt); in __iscsi_complete_pdu()
1287 if (!task) in __iscsi_complete_pdu()
1296 iscsi_scsi_cmd_rsp(conn, hdr, task, data, datalen); in __iscsi_complete_pdu()
1299 iscsi_data_in_rsp(conn, hdr, task); in __iscsi_complete_pdu()
1325 iscsi_complete_task(task, ISCSI_TASK_COMPLETED); in __iscsi_complete_pdu()
1335 rc = iscsi_nop_out_rsp(task, (struct iscsi_nopin*)hdr, in __iscsi_complete_pdu()
1348 iscsi_complete_task(task, ISCSI_TASK_COMPLETED); in __iscsi_complete_pdu()
1408 struct iscsi_task *task; in iscsi_itt_to_ctask() local
1413 task = iscsi_itt_to_task(conn, itt); in iscsi_itt_to_ctask()
1414 if (!task || !task->sc) in iscsi_itt_to_ctask()
1417 if (iscsi_cmd(task->sc)->age != conn->session->age) { in iscsi_itt_to_ctask()
1420 iscsi_cmd(task->sc)->age, conn->session->age); in iscsi_itt_to_ctask()
1424 return task; in iscsi_itt_to_ctask()
1501 static int iscsi_xmit_task(struct iscsi_conn *conn, struct iscsi_task *task, in iscsi_xmit_task() argument
1506 if (!conn->task) { in iscsi_xmit_task()
1513 if (!iscsi_get_task(task)) { in iscsi_xmit_task()
1519 conn->task = NULL; in iscsi_xmit_task()
1527 iscsi_put_task(task); in iscsi_xmit_task()
1538 conn->task = task; in iscsi_xmit_task()
1543 rc = conn->session->tt->xmit_task(task); in iscsi_xmit_task()
1547 task->last_xfer = jiffies; in iscsi_xmit_task()
1553 iscsi_get_task(task); in iscsi_xmit_task()
1554 conn->task = task; in iscsi_xmit_task()
1557 iscsi_put_task(task); in iscsi_xmit_task()
1567 void iscsi_requeue_task(struct iscsi_task *task) in iscsi_requeue_task() argument
1569 struct iscsi_conn *conn = task->conn; in iscsi_requeue_task()
1576 if (list_empty(&task->running)) { in iscsi_requeue_task()
1577 list_add_tail(&task->running, &conn->requeue); in iscsi_requeue_task()
1583 iscsi_put_task(task); in iscsi_requeue_task()
1601 struct iscsi_task *task; in iscsi_data_xmit() local
1611 if (conn->task) { in iscsi_data_xmit()
1612 rc = iscsi_xmit_task(conn, conn->task, false); in iscsi_data_xmit()
1624 task = list_entry(conn->mgmtqueue.next, struct iscsi_task, in iscsi_data_xmit()
1626 list_del_init(&task->running); in iscsi_data_xmit()
1627 if (iscsi_prep_mgmt_task(conn, task)) { in iscsi_data_xmit()
1630 __iscsi_put_task(task); in iscsi_data_xmit()
1634 rc = iscsi_xmit_task(conn, task, false); in iscsi_data_xmit()
1647 task = list_entry(conn->requeue.next, struct iscsi_task, in iscsi_data_xmit()
1650 if (iscsi_check_tmf_restrictions(task, ISCSI_OP_SCSI_DATA_OUT)) in iscsi_data_xmit()
1653 list_del_init(&task->running); in iscsi_data_xmit()
1654 rc = iscsi_xmit_task(conn, task, true); in iscsi_data_xmit()
1663 task = list_entry(conn->cmdqueue.next, struct iscsi_task, in iscsi_data_xmit()
1665 list_del_init(&task->running); in iscsi_data_xmit()
1667 fail_scsi_task(task, DID_IMM_RETRY); in iscsi_data_xmit()
1670 rc = iscsi_prep_scsi_cmd_pdu(task); in iscsi_data_xmit()
1673 fail_scsi_task(task, DID_IMM_RETRY); in iscsi_data_xmit()
1675 fail_scsi_task(task, DID_ABORT); in iscsi_data_xmit()
1678 rc = iscsi_xmit_task(conn, task, false); in iscsi_data_xmit()
1716 struct iscsi_task *task; in iscsi_alloc_task() local
1719 (void *) &task, sizeof(void *))) in iscsi_alloc_task()
1723 iscsi_cmd(sc)->task = task; in iscsi_alloc_task()
1725 refcount_set(&task->refcount, 1); in iscsi_alloc_task()
1726 task->state = ISCSI_TASK_PENDING; in iscsi_alloc_task()
1727 task->conn = conn; in iscsi_alloc_task()
1728 task->sc = sc; in iscsi_alloc_task()
1729 task->have_checked_conn = false; in iscsi_alloc_task()
1730 task->last_timeout = jiffies; in iscsi_alloc_task()
1731 task->last_xfer = jiffies; in iscsi_alloc_task()
1732 task->protected = false; in iscsi_alloc_task()
1733 INIT_LIST_HEAD(&task->running); in iscsi_alloc_task()
1734 return task; in iscsi_alloc_task()
1757 struct iscsi_task *task = NULL; in iscsi_queuecommand() local
1760 iscsi_cmd(sc)->task = NULL; in iscsi_queuecommand()
1834 task = iscsi_alloc_task(conn, sc); in iscsi_queuecommand()
1835 if (!task) { in iscsi_queuecommand()
1841 reason = iscsi_prep_scsi_cmd_pdu(task); in iscsi_queuecommand()
1851 if (session->tt->xmit_task(task)) { in iscsi_queuecommand()
1857 list_add_tail(&task->running, &conn->cmdqueue); in iscsi_queuecommand()
1867 iscsi_complete_task(task, ISCSI_TASK_REQUEUE_SCSIQ); in iscsi_queuecommand()
1877 iscsi_complete_task(task, ISCSI_TASK_REQUEUE_SCSIQ); in iscsi_queuecommand()
1965 struct iscsi_task *task; in fail_scsi_tasks() local
1971 task = session->cmds[i]; in fail_scsi_tasks()
1972 if (!task->sc || task->state == ISCSI_TASK_FREE) in fail_scsi_tasks()
1975 if (lun != -1 && lun != task->sc->device->lun) in fail_scsi_tasks()
1982 if (!iscsi_get_task(task)) { in fail_scsi_tasks()
1992 task->sc, task->itt, task->state); in fail_scsi_tasks()
1993 __fail_scsi_task(task, error); in fail_scsi_tasks()
1994 __iscsi_put_task(task); in fail_scsi_tasks()
2077 struct iscsi_task *task = NULL, *running_task; in iscsi_eh_cmd_timed_out() local
2090 task = iscsi_cmd(sc)->task; in iscsi_eh_cmd_timed_out()
2091 if (!task) { in iscsi_eh_cmd_timed_out()
2100 if (!iscsi_get_task(task)) { in iscsi_eh_cmd_timed_out()
2106 task = NULL; in iscsi_eh_cmd_timed_out()
2148 if (time_after(task->last_xfer, task->last_timeout)) { in iscsi_eh_cmd_timed_out()
2152 "%lu\n.", task->last_xfer, task->last_timeout); in iscsi_eh_cmd_timed_out()
2153 task->have_checked_conn = false; in iscsi_eh_cmd_timed_out()
2172 if (!running_task->sc || running_task == task || in iscsi_eh_cmd_timed_out()
2181 task->sc->jiffies_at_alloc)) in iscsi_eh_cmd_timed_out()
2184 if (time_after(running_task->last_xfer, task->last_timeout)) { in iscsi_eh_cmd_timed_out()
2200 task->last_xfer, running_task->last_xfer, in iscsi_eh_cmd_timed_out()
2201 task->last_timeout); in iscsi_eh_cmd_timed_out()
2210 if (task->have_checked_conn) in iscsi_eh_cmd_timed_out()
2218 task->have_checked_conn = true; in iscsi_eh_cmd_timed_out()
2225 task->have_checked_conn = true; in iscsi_eh_cmd_timed_out()
2231 if (task) { in iscsi_eh_cmd_timed_out()
2232 task->last_timeout = jiffies; in iscsi_eh_cmd_timed_out()
2233 iscsi_put_task(task); in iscsi_eh_cmd_timed_out()
2332 static void iscsi_prep_abort_task_pdu(struct iscsi_task *task, in iscsi_prep_abort_task_pdu() argument
2339 hdr->lun = task->lun; in iscsi_prep_abort_task_pdu()
2340 hdr->rtt = task->hdr_itt; in iscsi_prep_abort_task_pdu()
2341 hdr->refcmdsn = task->cmdsn; in iscsi_prep_abort_task_pdu()
2349 struct iscsi_task *task; in iscsi_eh_abort() local
2365 if (!iscsi_cmd(sc)->task) { in iscsi_eh_abort()
2387 task = iscsi_cmd(sc)->task; in iscsi_eh_abort()
2388 if (!task || !task->sc) { in iscsi_eh_abort()
2398 if (!iscsi_get_task(task)) { in iscsi_eh_abort()
2407 ISCSI_DBG_EH(session, "aborting [sc %p itt 0x%x]\n", sc, task->itt); in iscsi_eh_abort()
2414 if (task->state == ISCSI_TASK_PENDING) { in iscsi_eh_abort()
2415 fail_scsi_task(task, DID_ABORT); in iscsi_eh_abort()
2425 iscsi_prep_abort_task_pdu(task, hdr); in iscsi_eh_abort()
2444 fail_scsi_task(task, DID_ABORT); in iscsi_eh_abort()
2451 session->running_aborted_task = task; in iscsi_eh_abort()
2456 if (iscsi_task_is_completed(task)) { in iscsi_eh_abort()
2474 sc, task->itt); in iscsi_eh_abort()
2475 iscsi_put_task(task); in iscsi_eh_abort()
2484 task ? task->itt : 0); in iscsi_eh_abort()
2491 iscsi_put_task(task); in iscsi_eh_abort()
3078 struct iscsi_task *task = session->cmds[cmd_i]; in iscsi_session_setup() local
3081 task->dd_data = &task[1]; in iscsi_session_setup()
3082 task->itt = cmd_i; in iscsi_session_setup()
3083 task->state = ISCSI_TASK_FREE; in iscsi_session_setup()
3084 INIT_LIST_HEAD(&task->running); in iscsi_session_setup()
3357 struct iscsi_task *task; in fail_mgmt_tasks() local
3361 task = conn->session->cmds[i]; in fail_mgmt_tasks()
3362 if (task->sc) in fail_mgmt_tasks()
3365 if (task->state == ISCSI_TASK_FREE) in fail_mgmt_tasks()
3370 task->itt, task->state); in fail_mgmt_tasks()
3373 if (cleanup_queued_task(task)) { in fail_mgmt_tasks()
3379 if (task->state == ISCSI_TASK_PENDING) in fail_mgmt_tasks()
3381 iscsi_complete_task(task, state); in fail_mgmt_tasks()