diff options
| author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-11-08 16:10:44 -0500 |
|---|---|---|
| committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-11-08 16:13:38 -0500 |
| commit | 4863e525659abbc903aacc67fd916f12914f6c1d (patch) | |
| tree | 228f0fe16e5264922c383c5b9a6cfc17b30a5e6d /include | |
| parent | 4a9a6c8d538eff6d627fa14409c7c25aff652541 (diff) | |
target: Add per device xcopy_lun for copy offload I/O
This patch adds a se_device->xcopy_lun that is used for local
copy offload I/O, instead of allocating + initializing a pseudo
se_lun for each received EXTENDED_COPY operation.
Also, move declaration of struct se_lun + struct se_port_stat_grps
ahead of struct se_device.
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/target/target_core_base.h | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 1ad0a4240b00..96bf1b0239cc 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
| @@ -627,6 +627,34 @@ struct se_dev_attrib { | |||
| 627 | struct config_group da_group; | 627 | struct config_group da_group; |
| 628 | }; | 628 | }; |
| 629 | 629 | ||
| 630 | struct se_port_stat_grps { | ||
| 631 | struct config_group stat_group; | ||
| 632 | struct config_group scsi_port_group; | ||
| 633 | struct config_group scsi_tgt_port_group; | ||
| 634 | struct config_group scsi_transport_group; | ||
| 635 | }; | ||
| 636 | |||
| 637 | struct se_lun { | ||
| 638 | #define SE_LUN_LINK_MAGIC 0xffff7771 | ||
| 639 | u32 lun_link_magic; | ||
| 640 | /* See transport_lun_status_table */ | ||
| 641 | enum transport_lun_status_table lun_status; | ||
| 642 | u32 lun_access; | ||
| 643 | u32 lun_flags; | ||
| 644 | u32 unpacked_lun; | ||
| 645 | atomic_t lun_acl_count; | ||
| 646 | spinlock_t lun_acl_lock; | ||
| 647 | spinlock_t lun_sep_lock; | ||
| 648 | struct completion lun_shutdown_comp; | ||
| 649 | struct list_head lun_acl_list; | ||
| 650 | struct se_device *lun_se_dev; | ||
| 651 | struct se_port *lun_sep; | ||
| 652 | struct config_group lun_group; | ||
| 653 | struct se_port_stat_grps port_stat_grps; | ||
| 654 | struct completion lun_ref_comp; | ||
| 655 | struct percpu_ref lun_ref; | ||
| 656 | }; | ||
| 657 | |||
| 630 | struct se_dev_stat_grps { | 658 | struct se_dev_stat_grps { |
| 631 | struct config_group stat_group; | 659 | struct config_group stat_group; |
| 632 | struct config_group scsi_dev_group; | 660 | struct config_group scsi_dev_group; |
| @@ -710,6 +738,7 @@ struct se_device { | |||
| 710 | struct se_subsystem_api *transport; | 738 | struct se_subsystem_api *transport; |
| 711 | /* Linked list for struct se_hba struct se_device list */ | 739 | /* Linked list for struct se_hba struct se_device list */ |
| 712 | struct list_head dev_list; | 740 | struct list_head dev_list; |
| 741 | struct se_lun xcopy_lun; | ||
| 713 | }; | 742 | }; |
| 714 | 743 | ||
| 715 | struct se_hba { | 744 | struct se_hba { |
| @@ -729,34 +758,6 @@ struct se_hba { | |||
| 729 | struct se_subsystem_api *transport; | 758 | struct se_subsystem_api *transport; |
| 730 | }; | 759 | }; |
| 731 | 760 | ||
| 732 | struct se_port_stat_grps { | ||
| 733 | struct config_group stat_group; | ||
| 734 | struct config_group scsi_port_group; | ||
| 735 | struct config_group scsi_tgt_port_group; | ||
| 736 | struct config_group scsi_transport_group; | ||
| 737 | }; | ||
| 738 | |||
| 739 | struct se_lun { | ||
| 740 | #define SE_LUN_LINK_MAGIC 0xffff7771 | ||
| 741 | u32 lun_link_magic; | ||
| 742 | /* See transport_lun_status_table */ | ||
| 743 | enum transport_lun_status_table lun_status; | ||
| 744 | u32 lun_access; | ||
| 745 | u32 lun_flags; | ||
| 746 | u32 unpacked_lun; | ||
| 747 | atomic_t lun_acl_count; | ||
| 748 | spinlock_t lun_acl_lock; | ||
| 749 | spinlock_t lun_sep_lock; | ||
| 750 | struct completion lun_shutdown_comp; | ||
| 751 | struct list_head lun_acl_list; | ||
| 752 | struct se_device *lun_se_dev; | ||
| 753 | struct se_port *lun_sep; | ||
| 754 | struct config_group lun_group; | ||
| 755 | struct se_port_stat_grps port_stat_grps; | ||
| 756 | struct completion lun_ref_comp; | ||
| 757 | struct percpu_ref lun_ref; | ||
| 758 | }; | ||
| 759 | |||
| 760 | struct scsi_port_stats { | 761 | struct scsi_port_stats { |
| 761 | u64 cmd_pdus; | 762 | u64 cmd_pdus; |
| 762 | u64 tx_data_octets; | 763 | u64 tx_data_octets; |
