diff options
| -rw-r--r-- | drivers/target/loopback/tcm_loop.c | 12 | ||||
| -rw-r--r-- | drivers/target/target_core_pscsi.c | 4 | ||||
| -rw-r--r-- | drivers/target/target_core_transport.c | 22 | ||||
| -rw-r--r-- | drivers/target/tcm_fc/tfc_cmd.c | 20 | ||||
| -rw-r--r-- | include/scsi/scsi_tcq.h | 1 |
5 files changed, 39 insertions, 20 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c index 09681bafe10d..dee2a2c909f5 100644 --- a/drivers/target/loopback/tcm_loop.c +++ b/drivers/target/loopback/tcm_loop.c | |||
| @@ -31,7 +31,7 @@ | |||
| 31 | #include <scsi/scsi_host.h> | 31 | #include <scsi/scsi_host.h> |
| 32 | #include <scsi/scsi_device.h> | 32 | #include <scsi/scsi_device.h> |
| 33 | #include <scsi/scsi_cmnd.h> | 33 | #include <scsi/scsi_cmnd.h> |
| 34 | #include <scsi/libsas.h> /* For TASK_ATTR_* */ | 34 | #include <scsi/scsi_tcq.h> |
| 35 | 35 | ||
| 36 | #include <target/target_core_base.h> | 36 | #include <target/target_core_base.h> |
| 37 | #include <target/target_core_transport.h> | 37 | #include <target/target_core_transport.h> |
| @@ -95,17 +95,17 @@ static struct se_cmd *tcm_loop_allocate_core_cmd( | |||
| 95 | if (sc->device->tagged_supported) { | 95 | if (sc->device->tagged_supported) { |
| 96 | switch (sc->tag) { | 96 | switch (sc->tag) { |
| 97 | case HEAD_OF_QUEUE_TAG: | 97 | case HEAD_OF_QUEUE_TAG: |
| 98 | sam_task_attr = TASK_ATTR_HOQ; | 98 | sam_task_attr = MSG_HEAD_TAG; |
| 99 | break; | 99 | break; |
| 100 | case ORDERED_QUEUE_TAG: | 100 | case ORDERED_QUEUE_TAG: |
| 101 | sam_task_attr = TASK_ATTR_ORDERED; | 101 | sam_task_attr = MSG_ORDERED_TAG; |
| 102 | break; | 102 | break; |
| 103 | default: | 103 | default: |
| 104 | sam_task_attr = TASK_ATTR_SIMPLE; | 104 | sam_task_attr = MSG_SIMPLE_TAG; |
| 105 | break; | 105 | break; |
| 106 | } | 106 | } |
| 107 | } else | 107 | } else |
| 108 | sam_task_attr = TASK_ATTR_SIMPLE; | 108 | sam_task_attr = MSG_SIMPLE_TAG; |
| 109 | 109 | ||
| 110 | /* | 110 | /* |
| 111 | * Initialize struct se_cmd descriptor from target_core_mod infrastructure | 111 | * Initialize struct se_cmd descriptor from target_core_mod infrastructure |
| @@ -379,7 +379,7 @@ static int tcm_loop_device_reset(struct scsi_cmnd *sc) | |||
| 379 | * Initialize struct se_cmd descriptor from target_core_mod infrastructure | 379 | * Initialize struct se_cmd descriptor from target_core_mod infrastructure |
| 380 | */ | 380 | */ |
| 381 | transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, 0, | 381 | transport_init_se_cmd(se_cmd, se_tpg->se_tpg_tfo, se_sess, 0, |
| 382 | DMA_NONE, TASK_ATTR_SIMPLE, | 382 | DMA_NONE, MSG_SIMPLE_TAG, |
| 383 | &tl_cmd->tl_sense_buf[0]); | 383 | &tl_cmd->tl_sense_buf[0]); |
| 384 | /* | 384 | /* |
| 385 | * Allocate the LUN_RESET TMR | 385 | * Allocate the LUN_RESET TMR |
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 7ff6a35f26ac..331d423fd0e0 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c | |||
| @@ -41,7 +41,7 @@ | |||
| 41 | #include <scsi/scsi_device.h> | 41 | #include <scsi/scsi_device.h> |
| 42 | #include <scsi/scsi_cmnd.h> | 42 | #include <scsi/scsi_cmnd.h> |
| 43 | #include <scsi/scsi_host.h> | 43 | #include <scsi/scsi_host.h> |
| 44 | #include <scsi/libsas.h> /* For TASK_ATTR_* */ | 44 | #include <scsi/scsi_tcq.h> |
| 45 | 45 | ||
| 46 | #include <target/target_core_base.h> | 46 | #include <target/target_core_base.h> |
| 47 | #include <target/target_core_device.h> | 47 | #include <target/target_core_device.h> |
| @@ -911,7 +911,7 @@ static int pscsi_do_task(struct se_task *task) | |||
| 911 | * descriptor | 911 | * descriptor |
| 912 | */ | 912 | */ |
| 913 | blk_execute_rq_nowait(pdv->pdv_sd->request_queue, NULL, pt->pscsi_req, | 913 | blk_execute_rq_nowait(pdv->pdv_sd->request_queue, NULL, pt->pscsi_req, |
| 914 | (task->task_se_cmd->sam_task_attr == TASK_ATTR_HOQ), | 914 | (task->task_se_cmd->sam_task_attr == MSG_HEAD_TAG), |
| 915 | pscsi_req_done); | 915 | pscsi_req_done); |
| 916 | 916 | ||
| 917 | return PYX_TRANSPORT_SENT_TO_TRANSPORT; | 917 | return PYX_TRANSPORT_SENT_TO_TRANSPORT; |
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index beaf8fa89124..5b1ce81e3aa7 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
| @@ -42,7 +42,7 @@ | |||
| 42 | #include <net/tcp.h> | 42 | #include <net/tcp.h> |
| 43 | #include <scsi/scsi.h> | 43 | #include <scsi/scsi.h> |
| 44 | #include <scsi/scsi_cmnd.h> | 44 | #include <scsi/scsi_cmnd.h> |
| 45 | #include <scsi/libsas.h> /* For TASK_ATTR_* */ | 45 | #include <scsi/scsi_tcq.h> |
| 46 | 46 | ||
| 47 | #include <target/target_core_base.h> | 47 | #include <target/target_core_base.h> |
| 48 | #include <target/target_core_device.h> | 48 | #include <target/target_core_device.h> |
| @@ -1074,7 +1074,7 @@ static inline int transport_add_task_check_sam_attr( | |||
| 1074 | * head of the struct se_device->execute_task_list, and task_prev | 1074 | * head of the struct se_device->execute_task_list, and task_prev |
| 1075 | * after that for each subsequent task | 1075 | * after that for each subsequent task |
| 1076 | */ | 1076 | */ |
| 1077 | if (task->task_se_cmd->sam_task_attr == TASK_ATTR_HOQ) { | 1077 | if (task->task_se_cmd->sam_task_attr == MSG_HEAD_TAG) { |
| 1078 | list_add(&task->t_execute_list, | 1078 | list_add(&task->t_execute_list, |
| 1079 | (task_prev != NULL) ? | 1079 | (task_prev != NULL) ? |
| 1080 | &task_prev->t_execute_list : | 1080 | &task_prev->t_execute_list : |
| @@ -1873,7 +1873,7 @@ static int transport_check_alloc_task_attr(struct se_cmd *cmd) | |||
| 1873 | if (SE_DEV(cmd)->dev_task_attr_type != SAM_TASK_ATTR_EMULATED) | 1873 | if (SE_DEV(cmd)->dev_task_attr_type != SAM_TASK_ATTR_EMULATED) |
| 1874 | return 0; | 1874 | return 0; |
| 1875 | 1875 | ||
| 1876 | if (cmd->sam_task_attr == TASK_ATTR_ACA) { | 1876 | if (cmd->sam_task_attr == MSG_ACA_TAG) { |
| 1877 | DEBUG_STA("SAM Task Attribute ACA" | 1877 | DEBUG_STA("SAM Task Attribute ACA" |
| 1878 | " emulation is not supported\n"); | 1878 | " emulation is not supported\n"); |
| 1879 | return -1; | 1879 | return -1; |
| @@ -2517,7 +2517,7 @@ static inline int transport_execute_task_attr(struct se_cmd *cmd) | |||
| 2517 | * Check for the existence of HEAD_OF_QUEUE, and if true return 1 | 2517 | * Check for the existence of HEAD_OF_QUEUE, and if true return 1 |
| 2518 | * to allow the passed struct se_cmd list of tasks to the front of the list. | 2518 | * to allow the passed struct se_cmd list of tasks to the front of the list. |
| 2519 | */ | 2519 | */ |
| 2520 | if (cmd->sam_task_attr == TASK_ATTR_HOQ) { | 2520 | if (cmd->sam_task_attr == MSG_HEAD_TAG) { |
| 2521 | atomic_inc(&SE_DEV(cmd)->dev_hoq_count); | 2521 | atomic_inc(&SE_DEV(cmd)->dev_hoq_count); |
| 2522 | smp_mb__after_atomic_inc(); | 2522 | smp_mb__after_atomic_inc(); |
| 2523 | DEBUG_STA("Added HEAD_OF_QUEUE for CDB:" | 2523 | DEBUG_STA("Added HEAD_OF_QUEUE for CDB:" |
| @@ -2525,7 +2525,7 @@ static inline int transport_execute_task_attr(struct se_cmd *cmd) | |||
| 2525 | T_TASK(cmd)->t_task_cdb[0], | 2525 | T_TASK(cmd)->t_task_cdb[0], |
| 2526 | cmd->se_ordered_id); | 2526 | cmd->se_ordered_id); |
| 2527 | return 1; | 2527 | return 1; |
| 2528 | } else if (cmd->sam_task_attr == TASK_ATTR_ORDERED) { | 2528 | } else if (cmd->sam_task_attr == MSG_ORDERED_TAG) { |
| 2529 | spin_lock(&SE_DEV(cmd)->ordered_cmd_lock); | 2529 | spin_lock(&SE_DEV(cmd)->ordered_cmd_lock); |
| 2530 | list_add_tail(&cmd->se_ordered_list, | 2530 | list_add_tail(&cmd->se_ordered_list, |
| 2531 | &SE_DEV(cmd)->ordered_cmd_list); | 2531 | &SE_DEV(cmd)->ordered_cmd_list); |
| @@ -3424,7 +3424,7 @@ static int transport_generic_cmd_sequencer( | |||
| 3424 | * See spc4r17 section 5.3 | 3424 | * See spc4r17 section 5.3 |
| 3425 | */ | 3425 | */ |
| 3426 | if (SE_DEV(cmd)->dev_task_attr_type == SAM_TASK_ATTR_EMULATED) | 3426 | if (SE_DEV(cmd)->dev_task_attr_type == SAM_TASK_ATTR_EMULATED) |
| 3427 | cmd->sam_task_attr = TASK_ATTR_HOQ; | 3427 | cmd->sam_task_attr = MSG_HEAD_TAG; |
| 3428 | cmd->se_cmd_flags |= SCF_SCSI_CONTROL_NONSG_IO_CDB; | 3428 | cmd->se_cmd_flags |= SCF_SCSI_CONTROL_NONSG_IO_CDB; |
| 3429 | break; | 3429 | break; |
| 3430 | case READ_BUFFER: | 3430 | case READ_BUFFER: |
| @@ -3632,7 +3632,7 @@ static int transport_generic_cmd_sequencer( | |||
| 3632 | * See spc4r17 section 5.3 | 3632 | * See spc4r17 section 5.3 |
| 3633 | */ | 3633 | */ |
| 3634 | if (SE_DEV(cmd)->dev_task_attr_type == SAM_TASK_ATTR_EMULATED) | 3634 | if (SE_DEV(cmd)->dev_task_attr_type == SAM_TASK_ATTR_EMULATED) |
| 3635 | cmd->sam_task_attr = TASK_ATTR_HOQ; | 3635 | cmd->sam_task_attr = MSG_HEAD_TAG; |
| 3636 | cmd->se_cmd_flags |= SCF_SCSI_CONTROL_NONSG_IO_CDB; | 3636 | cmd->se_cmd_flags |= SCF_SCSI_CONTROL_NONSG_IO_CDB; |
| 3637 | break; | 3637 | break; |
| 3638 | default: | 3638 | default: |
| @@ -3790,21 +3790,21 @@ static void transport_complete_task_attr(struct se_cmd *cmd) | |||
| 3790 | struct se_cmd *cmd_p, *cmd_tmp; | 3790 | struct se_cmd *cmd_p, *cmd_tmp; |
| 3791 | int new_active_tasks = 0; | 3791 | int new_active_tasks = 0; |
| 3792 | 3792 | ||
| 3793 | if (cmd->sam_task_attr == TASK_ATTR_SIMPLE) { | 3793 | if (cmd->sam_task_attr == MSG_SIMPLE_TAG) { |
| 3794 | atomic_dec(&dev->simple_cmds); | 3794 | atomic_dec(&dev->simple_cmds); |
| 3795 | smp_mb__after_atomic_dec(); | 3795 | smp_mb__after_atomic_dec(); |
| 3796 | dev->dev_cur_ordered_id++; | 3796 | dev->dev_cur_ordered_id++; |
| 3797 | |||
