diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-11-14 11:36:29 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2011-12-06 01:00:52 -0500 |
commit | 2d3a4b51df4db2ee0415f42a63b9629a7977b975 (patch) | |
tree | fd83d9881b4d2041061d62271fea53af8a81be44 | |
parent | aad13ca20d960ab74b739d7bbe876dac4502f546 (diff) |
target: remove the t_tasks_fua se_cmd field
And use a SCF_FUA flag instead.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r-- | drivers/target/target_core_file.c | 2 | ||||
-rw-r--r-- | drivers/target/target_core_iblock.c | 2 | ||||
-rw-r--r-- | drivers/target/target_core_transport.c | 15 | ||||
-rw-r--r-- | include/target/target_core_base.h | 2 |
4 files changed, 13 insertions, 8 deletions
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index cdd47e8c7366..38211322415e 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c | |||
@@ -438,7 +438,7 @@ static int fd_do_task(struct se_task *task) | |||
438 | if (ret > 0 && | 438 | if (ret > 0 && |
439 | dev->se_sub_dev->se_dev_attrib.emulate_write_cache > 0 && | 439 | dev->se_sub_dev->se_dev_attrib.emulate_write_cache > 0 && |
440 | dev->se_sub_dev->se_dev_attrib.emulate_fua_write > 0 && | 440 | dev->se_sub_dev->se_dev_attrib.emulate_fua_write > 0 && |
441 | cmd->t_tasks_fua) { | 441 | (cmd->se_cmd_flags & SCF_FUA)) { |
442 | /* | 442 | /* |
443 | * We might need to be a bit smarter here | 443 | * We might need to be a bit smarter here |
444 | * and return some sense data to let the initiator | 444 | * and return some sense data to let the initiator |
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index c670b8c2c994..4aa992204438 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c | |||
@@ -531,7 +531,7 @@ static int iblock_do_task(struct se_task *task) | |||
531 | */ | 531 | */ |
532 | if (dev->se_sub_dev->se_dev_attrib.emulate_write_cache == 0 || | 532 | if (dev->se_sub_dev->se_dev_attrib.emulate_write_cache == 0 || |
533 | (dev->se_sub_dev->se_dev_attrib.emulate_fua_write > 0 && | 533 | (dev->se_sub_dev->se_dev_attrib.emulate_fua_write > 0 && |
534 | task->task_se_cmd->t_tasks_fua)) | 534 | (cmd->se_cmd_flags & SCF_FUA))) |
535 | rw = WRITE_FUA; | 535 | rw = WRITE_FUA; |
536 | else | 536 | else |
537 | rw = WRITE; | 537 | rw = WRITE; |
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index a66050ec2c2f..866af5d5869f 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -2572,7 +2572,8 @@ static int transport_generic_cmd_sequencer( | |||
2572 | goto out_unsupported_cdb; | 2572 | goto out_unsupported_cdb; |
2573 | size = transport_get_size(sectors, cdb, cmd); | 2573 | size = transport_get_size(sectors, cdb, cmd); |
2574 | cmd->t_task_lba = transport_lba_32(cdb); | 2574 | cmd->t_task_lba = transport_lba_32(cdb); |
2575 | cmd->t_tasks_fua = (cdb[1] & 0x8); | 2575 | if (cdb[1] & 0x8) |
2576 | cmd->se_cmd_flags |= SCF_FUA; | ||
2576 | cmd->se_cmd_flags |= SCF_SCSI_DATA_SG_IO_CDB; | 2577 | cmd->se_cmd_flags |= SCF_SCSI_DATA_SG_IO_CDB; |
2577 | break; | 2578 | break; |
2578 | case WRITE_12: | 2579 | case WRITE_12: |
@@ -2581,7 +2582,8 @@ static int transport_generic_cmd_sequencer( | |||
2581 | goto out_unsupported_cdb; | 2582 | goto out_unsupported_cdb; |
2582 | size = transport_get_size(sectors, cdb, cmd); | 2583 | size = transport_get_size(sectors, cdb, cmd); |
2583 | cmd->t_task_lba = transport_lba_32(cdb); | 2584 | cmd->t_task_lba = transport_lba_32(cdb); |
2584 | cmd->t_tasks_fua = (cdb[1] & 0x8); | 2585 | if (cdb[1] & 0x8) |
2586 | cmd->se_cmd_flags |= SCF_FUA; | ||
2585 | cmd->se_cmd_flags |= SCF_SCSI_DATA_SG_IO_CDB; | 2587 | cmd->se_cmd_flags |= SCF_SCSI_DATA_SG_IO_CDB; |
2586 | break; | 2588 | break; |
2587 | case WRITE_16: | 2589 | case WRITE_16: |
@@ -2590,7 +2592,8 @@ static int transport_generic_cmd_sequencer( | |||
2590 | goto out_unsupported_cdb; | 2592 | goto out_unsupported_cdb; |
2591 | size = transport_get_size(sectors, cdb, cmd); | 2593 | size = transport_get_size(sectors, cdb, cmd); |
2592 | cmd->t_task_lba = transport_lba_64(cdb); | 2594 | cmd->t_task_lba = transport_lba_64(cdb); |
2593 | cmd->t_tasks_fua = (cdb[1] & 0x8); | 2595 | if (cdb[1] & 0x8) |
2596 | cmd->se_cmd_flags |= SCF_FUA; | ||
2594 | cmd->se_cmd_flags |= SCF_SCSI_DATA_SG_IO_CDB; | 2597 | cmd->se_cmd_flags |= SCF_SCSI_DATA_SG_IO_CDB; |
2595 | break; | 2598 | break; |
2596 | case XDWRITEREAD_10: | 2599 | case XDWRITEREAD_10: |
@@ -2614,7 +2617,8 @@ static int transport_generic_cmd_sequencer( | |||
2614 | * Setup BIDI XOR callback to be run after I/O completion. | 2617 | * Setup BIDI XOR callback to be run after I/O completion. |
2615 | */ | 2618 | */ |
2616 | cmd->transport_complete_callback = &transport_xor_callback; | 2619 | cmd->transport_complete_callback = &transport_xor_callback; |
2617 | cmd->t_tasks_fua = (cdb[1] & 0x8); | 2620 | if (cdb[1] & 0x8) |
2621 | cmd->se_cmd_flags |= SCF_FUA; | ||
2618 | break; | 2622 | break; |
2619 | case VARIABLE_LENGTH_CMD: | 2623 | case VARIABLE_LENGTH_CMD: |
2620 | service_action = get_unaligned_be16(&cdb[8]); | 2624 | service_action = get_unaligned_be16(&cdb[8]); |
@@ -2642,7 +2646,8 @@ static int transport_generic_cmd_sequencer( | |||
2642 | * completion. | 2646 | * completion. |
2643 | */ | 2647 | */ |
2644 | cmd->transport_complete_callback = &transport_xor_callback; | 2648 | cmd->transport_complete_callback = &transport_xor_callback; |
2645 | cmd->t_tasks_fua = (cdb[10] & 0x8); | 2649 | if (cdb[1] & 0x8) |
2650 | cmd->se_cmd_flags |= SCF_FUA; | ||
2646 | break; | 2651 | break; |
2647 | case WRITE_SAME_32: | 2652 | case WRITE_SAME_32: |
2648 | sectors = transport_get_sectors_32(cdb, cmd, §or_ret); | 2653 | sectors = transport_get_sectors_32(cdb, cmd, §or_ret); |
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 29773342f2c6..357af4546d25 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -103,6 +103,7 @@ enum se_cmd_flags_table { | |||
103 | SCF_SCSI_NON_DATA_CDB = 0x00000040, | 103 | SCF_SCSI_NON_DATA_CDB = 0x00000040, |
104 | SCF_SCSI_CDB_EXCEPTION = 0x00000080, | 104 | SCF_SCSI_CDB_EXCEPTION = 0x00000080, |
105 | SCF_SCSI_RESERVATION_CONFLICT = 0x00000100, | 105 | SCF_SCSI_RESERVATION_CONFLICT = 0x00000100, |
106 | SCF_FUA = 0x00000200, | ||
106 | SCF_SE_LUN_CMD = 0x00000800, | 107 | SCF_SE_LUN_CMD = 0x00000800, |
107 | SCF_SE_ALLOW_EOO = 0x00001000, | 108 | SCF_SE_ALLOW_EOO = 0x00001000, |
108 | SCF_SENT_CHECK_CONDITION = 0x00004000, | 109 | SCF_SENT_CHECK_CONDITION = 0x00004000, |
@@ -458,7 +459,6 @@ struct se_cmd { | |||
458 | unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; | 459 | unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; |
459 | unsigned long long t_task_lba; | 460 | unsigned long long t_task_lba; |
460 | int t_tasks_failed; | 461 | int t_tasks_failed; |
461 | int t_tasks_fua; | ||
462 | bool t_tasks_bidi; | 462 | bool t_tasks_bidi; |
463 | u32 t_tasks_sg_chained_no; | 463 | u32 t_tasks_sg_chained_no; |
464 | atomic_t t_fe_count; | 464 | atomic_t t_fe_count; |