target: remove transport_generic_handle_cdb_map
authorChristoph Hellwig <hch@infradead.org>
Sun, 8 Jul 2012 19:58:48 +0000 (15:58 -0400)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 17 Jul 2012 00:35:21 +0000 (17:35 -0700)
Remove this command submission path which is not used by any in-tree driver.
This also removes the now unused new_cmd_map fabtric method, which a few
drivers implemented despite never calling transport_generic_handle_cdb_map.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/scsi/qla2xxx/tcm_qla2xxx.c
drivers/target/target_core_transport.c
drivers/usb/gadget/tcm_usb_gadget.c
include/target/target_core_base.h
include/target/target_core_fabric.h

index 977cb8b..d85a817 100644 (file)
@@ -1678,7 +1678,6 @@ static struct target_core_fabric_ops tcm_qla2xxx_ops = {
        .tpg_alloc_fabric_acl           = tcm_qla2xxx_alloc_fabric_acl,
        .tpg_release_fabric_acl         = tcm_qla2xxx_release_fabric_acl,
        .tpg_get_inst_index             = tcm_qla2xxx_tpg_get_inst_index,
-       .new_cmd_map                    = NULL,
        .check_stop_free                = tcm_qla2xxx_check_stop_free,
        .release_cmd                    = tcm_qla2xxx_release_cmd,
        .put_session                    = tcm_qla2xxx_put_session,
index 68f0c8d..9b7bbbe 100644 (file)
@@ -1661,25 +1661,6 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
 }
 EXPORT_SYMBOL(target_submit_tmr);
 
-/*
- * Used by fabric module frontends defining a TFO->new_cmd_map() caller
- * to  queue up a newly setup se_cmd w/ TRANSPORT_NEW_CMD_MAP in order to
- * complete setup in TCM process context w/ TFO->new_cmd_map().
- */
-int transport_generic_handle_cdb_map(
-       struct se_cmd *cmd)
-{
-       if (!cmd->se_lun) {
-               dump_stack();
-               pr_err("cmd->se_lun is NULL\n");
-               return -EINVAL;
-       }
-
-       transport_add_cmd_to_queue(cmd, TRANSPORT_NEW_CMD_MAP, false);
-       return 0;
-}
-EXPORT_SYMBOL(transport_generic_handle_cdb_map);
-
 /*     transport_generic_handle_tmr():
  *
  *
@@ -1784,13 +1765,7 @@ void transport_generic_request_failure(struct se_cmd *cmd)
                cmd->scsi_sense_reason = TCM_UNSUPPORTED_SCSI_OPCODE;
                break;
        }
-       /*
-        * If a fabric does not define a cmd->se_tfo->new_cmd_map caller,
-        * make the call to transport_send_check_condition_and_sense()
-        * directly.  Otherwise expect the fabric to make the call to
-        * transport_send_check_condition_and_sense() after handling
-        * possible unsoliticied write data payloads.
-        */
+
        ret = transport_send_check_condition_and_sense(cmd,
                        cmd->scsi_sense_reason, 0);
        if (ret == -EAGAIN || ret == -ENOMEM)
@@ -3247,23 +3222,6 @@ get_cmd:
                case TRANSPORT_NEW_CMD:
                        BUG();
                        break;
-               case TRANSPORT_NEW_CMD_MAP:
-                       if (!cmd->se_tfo->new_cmd_map) {
-                               pr_err("cmd->se_tfo->new_cmd_map is"
-                                       " NULL for TRANSPORT_NEW_CMD_MAP\n");
-                               BUG();
-                       }
-                       ret = cmd->se_tfo->new_cmd_map(cmd);
-                       if (ret < 0) {
-                               transport_generic_request_failure(cmd);
-                               break;
-                       }
-                       ret = transport_generic_new_cmd(cmd);
-                       if (ret < 0) {
-                               transport_generic_request_failure(cmd);
-                               break;
-                       }
-                       break;
                case TRANSPORT_PROCESS_TMR:
                        transport_generic_do_tmr(cmd);
                        break;
index 031d44e..02ace18 100644 (file)
@@ -1400,19 +1400,6 @@ static u32 usbg_tpg_get_inst_index(struct se_portal_group *se_tpg)
        return 1;
 }
 
-static int usbg_new_cmd(struct se_cmd *se_cmd)
-{
-       struct usbg_cmd *cmd = container_of(se_cmd, struct usbg_cmd,
-                       se_cmd);
-       int ret;
-
-       ret = target_setup_cmd_from_cdb(se_cmd, cmd->cmd_buf);
-       if (ret)
-               return ret;
-
-       return transport_generic_map_mem_to_cmd(se_cmd, NULL, 0, NULL, 0);
-}
-
 static void usbg_cmd_release(struct kref *ref)
 {
        struct usbg_cmd *cmd = container_of(ref, struct usbg_cmd,
@@ -1902,7 +1889,6 @@ static struct target_core_fabric_ops usbg_ops = {
        .tpg_alloc_fabric_acl           = usbg_alloc_fabric_acl,
        .tpg_release_fabric_acl         = usbg_release_fabric_acl,
        .tpg_get_inst_index             = usbg_tpg_get_inst_index,
-       .new_cmd_map                    = usbg_new_cmd,
        .release_cmd                    = usbg_release_cmd,
        .shutdown_session               = usbg_shutdown_session,
        .close_session                  = usbg_close_session,
index 72a41dd..11052b2 100644 (file)
@@ -149,7 +149,6 @@ enum transport_state_table {
        TRANSPORT_COMPLETE      = 6,
        TRANSPORT_PROCESS_TMR   = 9,
        TRANSPORT_ISTATE_PROCESSING = 11,
-       TRANSPORT_NEW_CMD_MAP   = 16,
        TRANSPORT_COMPLETE_QF_WP = 18,
        TRANSPORT_COMPLETE_QF_OK = 19,
 };
index 69321bc..c3ad1ec 100644 (file)
@@ -33,12 +33,6 @@ struct target_core_fabric_ops {
                                        struct se_node_acl *);
        u32 (*tpg_get_inst_index)(struct se_portal_group *);
        /*
-        * Optional function pointer for TCM to perform command map
-        * from TCM processing thread context, for those struct se_cmd
-        * initially allocated in interrupt context.
-        */
-       int (*new_cmd_map)(struct se_cmd *);
-       /*
         * Optional to release struct se_cmd and fabric dependent allocated
         * I/O descriptor in transport_cmd_check_stop().
         *
@@ -115,7 +109,6 @@ int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
                void *fabric_tmr_ptr, unsigned char tm_type,
                gfp_t, unsigned int, int);
 int    transport_handle_cdb_direct(struct se_cmd *);
-int    transport_generic_handle_cdb_map(struct se_cmd *);
 int    transport_generic_map_mem_to_cmd(struct se_cmd *cmd,
                struct scatterlist *, u32, struct scatterlist *, u32);
 int    transport_generic_new_cmd(struct se_cmd *);