target: remove struct se_task
[firefly-linux-kernel-4.4.55.git] / include / target / target_core_base.h
index 5a4249d84040bb0559ab3d67a53827206e9e8a78..55a80bd507032f1f39d921796d789e6168598c0a 100644 (file)
@@ -140,14 +140,6 @@ enum transport_tpg_type_table {
        TRANSPORT_TPG_TYPE_DISCOVERY = 1,
 };
 
-/* struct se_task->task_flags */
-enum se_task_flags {
-       TF_ACTIVE               = (1 << 0),
-       TF_SENT                 = (1 << 1),
-       TF_REQUEST_STOP         = (1 << 2),
-       TF_HAS_SENSE            = (1 << 3),
-};
-
 /* Special transport agnostic struct se_cmd->t_states */
 enum transport_state_table {
        TRANSPORT_NO_STATE      = 0,
@@ -485,21 +477,6 @@ struct se_queue_obj {
        wait_queue_head_t       thread_wq;
 };
 
-struct se_task {
-       u32                     task_sectors;
-       struct se_cmd           *task_se_cmd;
-       struct scatterlist      *task_sg;
-       u32                     task_sg_nents;
-       u16                     task_flags;
-       u8                      task_scsi_status;
-       enum dma_data_direction task_data_direction;
-       struct list_head        t_list;
-       struct list_head        t_execute_list;
-       struct list_head        t_state_list;
-       bool                    t_state_active;
-       struct completion       task_stop_comp;
-};
-
 struct se_tmr_req {
        /* Task Management function to be performed */
        u8                      function;
@@ -564,7 +541,7 @@ struct se_cmd {
        struct completion       cmd_wait_comp;
        struct kref             cmd_kref;
        struct target_core_fabric_ops *se_tfo;
-       int (*execute_task)(struct se_task *);
+       int (*execute_cmd)(struct se_cmd *);
        void (*transport_complete_callback)(struct se_cmd *);
 
        unsigned char           *t_task_cdb;
@@ -574,7 +551,6 @@ struct se_cmd {
        atomic_t                t_se_count;
        atomic_t                t_task_cdbs_left;
        atomic_t                t_task_cdbs_ex_left;
-       atomic_t                t_task_cdbs_sent;
        unsigned int            transport_state;
 #define CMD_T_ABORTED          (1 << 0)
 #define CMD_T_ACTIVE           (1 << 1)
@@ -586,6 +562,8 @@ struct se_cmd {
 #define CMD_T_LUN_STOP         (1 << 7)
 #define CMD_T_LUN_FE_STOP      (1 << 8)
 #define CMD_T_DEV_ACTIVE       (1 << 9)
+#define CMD_T_REQUEST_STOP     (1 << 10)
+#define CMD_T_BUSY             (1 << 11)
        spinlock_t              t_state_lock;
        struct completion       t_transport_stop_comp;
        struct completion       transport_lun_fe_stop_comp;
@@ -599,10 +577,15 @@ struct se_cmd {
        struct scatterlist      *t_bidi_data_sg;
        unsigned int            t_bidi_data_nents;
 
-       /* Used for BIDI READ */
-       struct list_head        t_task_list;
-       u32                     t_task_list_num;
+       struct list_head        execute_list;
+       struct list_head        state_list;
+       bool                    state_active;
+
+       /* old task stop completion, consider merging with some of the above */
+       struct completion       task_stop_comp;
 
+       /* backend private data */
+       void                    *priv;
 };
 
 struct se_ua {
@@ -826,8 +809,8 @@ struct se_device {
        struct task_struct      *process_thread;
        struct work_struct      qf_work_queue;
        struct list_head        delayed_cmd_list;
-       struct list_head        execute_task_list;
-       struct list_head        state_task_list;
+       struct list_head        execute_list;
+       struct list_head        state_list;
        struct list_head        qf_cmd_list;
        /* Pointer to associated SE HBA */
        struct se_hba           *se_hba;