target: remove the always-noop ->new_cmd_failure method
[deliverable/linux.git] / drivers / target / tcm_fc / tfc_cmd.c
index b2a106729d4914eca2c275adb956a944939d9b99..9a3b486e1aad032bef37d4c495820e415d99fff3 100644 (file)
@@ -60,7 +60,6 @@ void ft_dump_cmd(struct ft_cmd *cmd, const char *caller)
        struct fc_seq *sp;
        struct se_cmd *se_cmd;
        struct se_mem *mem;
-       struct se_transport_task *task;
 
        if (!(ft_debug_logging & FT_DEBUG_IO))
                return;
@@ -72,16 +71,15 @@ void ft_dump_cmd(struct ft_cmd *cmd, const char *caller)
                caller, cmd, cmd->cdb);
        printk(KERN_INFO "%s: cmd %p lun %d\n", caller, cmd, cmd->lun);
 
-       task = T_TASK(se_cmd);
-       printk(KERN_INFO "%s: cmd %p task %p se_num %u buf %p len %u se_cmd_flags <0x%x>\n",
-              caller, cmd, task, task->t_tasks_se_num,
-              task->t_task_buf, se_cmd->data_length, se_cmd->se_cmd_flags);
-       if (task->t_mem_list)
-               list_for_each_entry(mem, task->t_mem_list, se_list)
-                       printk(KERN_INFO "%s: cmd %p mem %p page %p "
-                              "len 0x%x off 0x%x\n",
-                              caller, cmd, mem,
-                              mem->se_page, mem->se_len, mem->se_off);
+       printk(KERN_INFO "%s: cmd %p se_num %u buf %p len %u se_cmd_flags <0x%x>\n",
+              caller, cmd, se_cmd->t_tasks_se_num,
+              se_cmd->t_task_buf, se_cmd->data_length, se_cmd->se_cmd_flags);
+
+       list_for_each_entry(mem, &se_cmd->t_mem_list, se_list)
+               printk(KERN_INFO "%s: cmd %p mem %p page %p "
+                      "len 0x%x off 0x%x\n",
+                      caller, cmd, mem,
+                      mem->se_page, mem->se_len, mem->se_off);
        sp = cmd->seq;
        if (sp) {
                ep = fc_seq_exch(sp);
@@ -262,9 +260,9 @@ int ft_write_pending(struct se_cmd *se_cmd)
                                 * TCM/LIO target
                                 */
                                transport_do_task_sg_chain(se_cmd);
-                               cmd->sg = T_TASK(se_cmd)->t_tasks_sg_chained;
+                               cmd->sg = se_cmd->t_tasks_sg_chained;
                                cmd->sg_cnt =
-                                       T_TASK(se_cmd)->t_tasks_sg_chained_no;
+                                       se_cmd->t_tasks_sg_chained_no;
                        }
                        if (cmd->sg && lport->tt.ddp_setup(lport, ep->xid,
                                                    cmd->sg, cmd->sg_cnt))
@@ -294,12 +292,6 @@ int ft_is_state_remove(struct se_cmd *se_cmd)
        return 0;       /* XXX TBD */
 }
 
-void ft_new_cmd_failure(struct se_cmd *se_cmd)
-{
-       /* XXX TBD */
-       printk(KERN_INFO "%s: se_cmd %p\n", __func__, se_cmd);
-}
-
 /*
  * FC sequence response handler for follow-on sequences (data) and aborts.
  */
@@ -438,7 +430,7 @@ static void ft_send_tm(struct ft_cmd *cmd)
        switch (fcp->fc_tm_flags) {
        case FCP_TMF_LUN_RESET:
                cmd->lun = scsilun_to_int((struct scsi_lun *)fcp->fc_lun);
-               if (transport_get_lun_for_tmr(&cmd->se_cmd, cmd->lun) < 0) {
+               if (transport_lookup_tmr_lun(&cmd->se_cmd, cmd->lun) < 0) {
                        /*
                         * Make sure to clean up newly allocated TMR request
                         * since "unable to  handle TMR request because failed
@@ -637,7 +629,7 @@ static void ft_send_cmd(struct ft_cmd *cmd)
        fc_seq_exch(cmd->seq)->lp->tt.seq_set_resp(cmd->seq, ft_recv_seq, cmd);
 
        cmd->lun = scsilun_to_int((struct scsi_lun *)fcp->fc_lun);
-       ret = transport_get_lun_for_cmd(&cmd->se_cmd, NULL, cmd->lun);
+       ret = transport_lookup_cmd_lun(&cmd->se_cmd, cmd->lun);
        if (ret < 0) {
                ft_dump_cmd(cmd, __func__);
                transport_send_check_condition_and_sense(&cmd->se_cmd,
@@ -650,13 +642,13 @@ static void ft_send_cmd(struct ft_cmd *cmd)
        FT_IO_DBG("r_ctl %x alloc task ret %d\n", fh->fh_r_ctl, ret);
        ft_dump_cmd(cmd, __func__);
 
-       if (ret == -1) {
+       if (ret == -ENOMEM) {
                transport_send_check_condition_and_sense(se_cmd,
                                TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE, 0);
                transport_generic_free_cmd(se_cmd, 0, 1, 0);
                return;
        }
-       if (ret == -2) {
+       if (ret == -EINVAL) {
                if (se_cmd->se_cmd_flags & SCF_SCSI_RESERVATION_CONFLICT)
                        ft_queue_status(se_cmd);
                else
@@ -670,7 +662,6 @@ static void ft_send_cmd(struct ft_cmd *cmd)
 
 err:
        ft_send_resp_code(cmd, FCP_CMND_FIELDS_INVALID);
-       return;
 }
 
 /*
This page took 0.065669 seconds and 5 git commands to generate.