Lines Matching refs:se_cmd

54 static void transport_complete_task_attr(struct se_cmd *cmd);
55 static void translate_sense_reason(struct se_cmd *cmd, sense_reason_t reason);
56 static void transport_handle_queue_full(struct se_cmd *cmd,
696 static void target_remove_from_state_list(struct se_cmd *cmd) in target_remove_from_state_list()
712 static void target_remove_from_tmr_list(struct se_cmd *cmd) in target_remove_from_tmr_list()
734 static int transport_cmd_check_stop_to_fabric(struct se_cmd *cmd) in transport_cmd_check_stop_to_fabric()
765 static void transport_lun_remove_cmd(struct se_cmd *cmd) in transport_lun_remove_cmd()
786 struct se_cmd *cmd = container_of(work, struct se_cmd, work); in target_complete_failure_work()
795 static unsigned char *transport_get_sense_buffer(struct se_cmd *cmd) in transport_get_sense_buffer()
814 void transport_copy_sense_to_cmd(struct se_cmd *cmd, unsigned char *sense) in transport_copy_sense_to_cmd()
832 static void target_handle_abort(struct se_cmd *cmd) in target_handle_abort()
880 struct se_cmd *cmd = container_of(work, struct se_cmd, work); in target_abort_work()
885 static bool target_cmd_interrupted(struct se_cmd *cmd) in target_cmd_interrupted()
906 void target_complete_cmd_with_sense(struct se_cmd *cmd, u8 scsi_status, in target_complete_cmd_with_sense()
948 void target_complete_cmd(struct se_cmd *cmd, u8 scsi_status) in target_complete_cmd()
956 void target_set_cmd_data_length(struct se_cmd *cmd, int length) in target_set_cmd_data_length()
971 void target_complete_cmd_with_length(struct se_cmd *cmd, u8 scsi_status, int length) in target_complete_cmd_with_length()
982 static void target_add_to_state_list(struct se_cmd *cmd) in target_add_to_state_list()
999 static void transport_write_pending_qf(struct se_cmd *cmd);
1000 static void transport_complete_qf(struct se_cmd *cmd);
1007 struct se_cmd *cmd, *cmd_tmp; in target_qf_do_work()
1031 unsigned char *transport_dump_cmd_direction(struct se_cmd *cmd) in transport_dump_cmd_direction()
1324 target_check_max_data_sg_nents(struct se_cmd *cmd, struct se_device *dev, in target_check_max_data_sg_nents()
1386 target_cmd_size_check(struct se_cmd *cmd, unsigned int size) in target_cmd_size_check()
1448 void __target_init_cmd(struct se_cmd *cmd, in __target_init_cmd()
1483 transport_check_alloc_task_attr(struct se_cmd *cmd) in transport_check_alloc_task_attr()
1504 target_cmd_init_cdb(struct se_cmd *cmd, unsigned char *cdb, gfp_t gfp) in target_cmd_init_cdb()
1555 target_cmd_parse_cdb(struct se_cmd *cmd) in target_cmd_parse_cdb()
1584 struct se_cmd *cmd) in transport_handle_cdb_direct()
1620 transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *sgl, in transport_generic_map_mem_to_cmd()
1667 int target_init_cmd(struct se_cmd *se_cmd, struct se_session *se_sess, in target_init_cmd() argument
1675 BUG_ON(se_cmd->se_tfo || se_cmd->se_sess); in target_init_cmd()
1678 se_cmd->se_cmd_flags |= SCF_USE_CPUID; in target_init_cmd()
1683 se_cmd->se_cmd_flags |= SCF_BIDI; in target_init_cmd()
1686 se_cmd->unknown_data_length = 1; in target_init_cmd()
1692 __target_init_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, data_length, in target_init_cmd()
1701 return target_get_sess_cmd(se_cmd, flags & TARGET_SCF_ACK_KREF); in target_init_cmd()
1724 int target_submit_prep(struct se_cmd *se_cmd, unsigned char *cdb, in target_submit_prep() argument
1732 rc = target_cmd_init_cdb(se_cmd, cdb, gfp); in target_submit_prep()
1739 rc = transport_lookup_cmd_lun(se_cmd); in target_submit_prep()
1743 rc = target_cmd_parse_cdb(se_cmd); in target_submit_prep()
1752 se_cmd->t_prot_sg = sgl_prot; in target_submit_prep()
1753 se_cmd->t_prot_nents = sgl_prot_count; in target_submit_prep()
1754 se_cmd->se_cmd_flags |= SCF_PASSTHROUGH_PROT_SG_TO_MEM_NOALLOC; in target_submit_prep()
1765 rc = transport_generic_map_mem_to_cmd(se_cmd, sgl, sgl_count, in target_submit_prep()
1774 transport_send_check_condition_and_sense(se_cmd, rc, 0); in target_submit_prep()
1775 target_put_sess_cmd(se_cmd); in target_submit_prep()
1779 transport_generic_request_failure(se_cmd, rc); in target_submit_prep()
1791 void target_submit(struct se_cmd *se_cmd) in target_submit() argument
1793 struct scatterlist *sgl = se_cmd->t_data_sg; in target_submit()
1798 if (se_cmd->t_data_nents != 0) { in target_submit()
1808 if (!(se_cmd->se_cmd_flags & SCF_SCSI_DATA_CDB) && in target_submit()
1809 se_cmd->data_direction == DMA_FROM_DEVICE) { in target_submit()
1825 core_alua_check_nonop_delay(se_cmd); in target_submit()
1827 transport_handle_cdb_direct(se_cmd); in target_submit()
1856 void target_submit_cmd(struct se_cmd *se_cmd, struct se_session *se_sess, in target_submit_cmd() argument
1862 rc = target_init_cmd(se_cmd, se_sess, sense, unpacked_lun, data_length, in target_submit_cmd()
1868 if (target_submit_prep(se_cmd, cdb, NULL, 0, NULL, 0, NULL, 0, in target_submit_cmd()
1872 target_submit(se_cmd); in target_submit_cmd()
1909 struct se_cmd *se_cmd, *next_cmd; in target_queued_submit_work() local
1920 llist_for_each_entry_safe(se_cmd, next_cmd, cmd_list, se_cmd_list) { in target_queued_submit_work()
1922 se_dev = se_cmd->se_dev; in target_queued_submit_work()
1926 target_submit(se_cmd); in target_queued_submit_work()
1937 void target_queue_submission(struct se_cmd *se_cmd) in target_queue_submission() argument
1939 struct se_device *se_dev = se_cmd->se_dev; in target_queue_submission()
1940 int cpu = se_cmd->cpuid; in target_queue_submission()
1944 llist_add(&se_cmd->se_cmd_list, &sq->cmd_list); in target_queue_submission()
1951 struct se_cmd *se_cmd = container_of(work, struct se_cmd, work); in target_complete_tmr_failure() local
1953 se_cmd->se_tmr_req->response = TMR_LUN_DOES_NOT_EXIST; in target_complete_tmr_failure()
1954 se_cmd->se_tfo->queue_tm_rsp(se_cmd); in target_complete_tmr_failure()
1956 transport_lun_remove_cmd(se_cmd); in target_complete_tmr_failure()
1957 transport_cmd_check_stop_to_fabric(se_cmd); in target_complete_tmr_failure()
1977 int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess, in target_submit_tmr() argument
1988 __target_init_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, in target_submit_tmr()
1995 ret = core_tmr_alloc_req(se_cmd, fabric_tmr_ptr, tm_type, gfp); in target_submit_tmr()
2000 se_cmd->se_tmr_req->ref_task_tag = tag; in target_submit_tmr()
2003 ret = target_get_sess_cmd(se_cmd, flags & TARGET_SCF_ACK_KREF); in target_submit_tmr()
2005 core_tmr_release_req(se_cmd->se_tmr_req); in target_submit_tmr()
2009 ret = transport_lookup_tmr_lun(se_cmd); in target_submit_tmr()
2013 transport_generic_handle_tmr(se_cmd); in target_submit_tmr()
2021 INIT_WORK(&se_cmd->work, target_complete_tmr_failure); in target_submit_tmr()
2022 schedule_work(&se_cmd->work); in target_submit_tmr()
2030 void transport_generic_request_failure(struct se_cmd *cmd, in transport_generic_request_failure()
2135 void __target_execute_cmd(struct se_cmd *cmd, bool do_checks) in __target_execute_cmd()
2176 static int target_write_prot_action(struct se_cmd *cmd) in target_write_prot_action()
2211 static bool target_handle_task_attr(struct se_cmd *cmd) in target_handle_task_attr()
2275 void target_execute_cmd(struct se_cmd *cmd) in target_execute_cmd()
2312 struct se_cmd *cmd; in target_do_delayed_work()
2318 struct se_cmd, se_delayed_node); in target_do_delayed_work()
2353 static void transport_complete_task_attr(struct se_cmd *cmd) in transport_complete_task_attr()
2387 static void transport_complete_qf(struct se_cmd *cmd) in transport_complete_qf()
2455 static void transport_handle_queue_full(struct se_cmd *cmd, struct se_device *dev, in transport_handle_queue_full()
2482 static bool target_read_prot_action(struct se_cmd *cmd) in target_read_prot_action()
2512 struct se_cmd *cmd = container_of(work, struct se_cmd, work); in target_complete_ok_work()
2661 static inline void transport_reset_sgl_orig(struct se_cmd *cmd) in transport_reset_sgl_orig()
2677 static inline void transport_free_pages(struct se_cmd *cmd) in transport_free_pages()
2710 void *transport_kmap_data_sg(struct se_cmd *cmd) in transport_kmap_data_sg()
2747 void transport_kunmap_data_sg(struct se_cmd *cmd) in transport_kunmap_data_sg()
2778 transport_generic_new_cmd(struct se_cmd *cmd) in transport_generic_new_cmd()
2879 static void transport_write_pending_qf(struct se_cmd *cmd) in transport_write_pending_qf()
2905 __transport_wait_for_tasks(struct se_cmd *, bool, bool *, bool *,
2908 static void target_wait_free_cmd(struct se_cmd *cmd, bool *aborted, bool *tas) in target_wait_free_cmd()
2921 void target_put_cmd_and_wait(struct se_cmd *cmd) in target_put_cmd_and_wait()
2954 int transport_generic_free_cmd(struct se_cmd *cmd, int wait_for_tasks) in transport_generic_free_cmd()
2992 int target_get_sess_cmd(struct se_cmd *se_cmd, bool ack_kref) in target_get_sess_cmd() argument
3002 kref_get(&se_cmd->cmd_kref); in target_get_sess_cmd()
3003 se_cmd->se_cmd_flags |= SCF_ACK_KREF; in target_get_sess_cmd()
3010 if (se_cmd->cmd_cnt) { in target_get_sess_cmd()
3011 if (!percpu_ref_tryget_live(&se_cmd->cmd_cnt->refcnt)) in target_get_sess_cmd()
3015 target_put_sess_cmd(se_cmd); in target_get_sess_cmd()
3021 static void target_free_cmd_mem(struct se_cmd *cmd) in target_free_cmd_mem()
3033 struct se_cmd *se_cmd = container_of(kref, struct se_cmd, cmd_kref); in target_release_cmd_kref() local
3034 struct target_cmd_counter *cmd_cnt = se_cmd->cmd_cnt; in target_release_cmd_kref()
3035 struct completion *free_compl = se_cmd->free_compl; in target_release_cmd_kref()
3036 struct completion *abrt_compl = se_cmd->abrt_compl; in target_release_cmd_kref()
3038 target_free_cmd_mem(se_cmd); in target_release_cmd_kref()
3039 se_cmd->se_tfo->release_cmd(se_cmd); in target_release_cmd_kref()
3056 int target_put_sess_cmd(struct se_cmd *se_cmd) in target_put_sess_cmd() argument
3058 return kref_put(&se_cmd->cmd_kref, target_release_cmd_kref); in target_put_sess_cmd()
3141 void target_show_cmd(const char *pfx, struct se_cmd *cmd) in target_show_cmd()
3239 __transport_wait_for_tasks(struct se_cmd *cmd, bool fabric_stop, in __transport_wait_for_tasks()
3292 bool transport_wait_for_tasks(struct se_cmd *cmd) in transport_wait_for_tasks()
3493 static void translate_sense_reason(struct se_cmd *cmd, sense_reason_t reason) in translate_sense_reason()
3531 transport_send_check_condition_and_sense(struct se_cmd *cmd, in transport_send_check_condition_and_sense()
3560 int target_send_busy(struct se_cmd *cmd) in target_send_busy()
3572 struct se_cmd *cmd = container_of(work, struct se_cmd, work); in target_tmr_work()
3625 struct se_cmd *cmd) in transport_generic_handle_tmr()