diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-05-19 03:03:07 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-06-01 03:27:38 -0400 |
commit | 4cc987eaff9144182cde88d6d132420c28d3f81b (patch) | |
tree | 15cf7d432599e1e09446462968ef01c4d10a087e /include/target | |
parent | adf653f92f38e80a78bb77e912d49bcc8055330f (diff) |
target: Drop lun_sep_lock for se_lun->lun_se_dev RCU usage
With se_port and t10_alua_tg_pt_gp_member being absored into se_lun,
there is no need for an extra lock to protect se_lun->lun_se_dev
assignment.
This patch also converts backend drivers to use call_rcu() release
to allow any se_device readers to complete. The call_rcu() instead
of kfree_rcu() is required here because se_device is embedded into
the backend driver specific structure.
Also, convert se_lun->lun_stats to use atomic_long_t within the
target_complete_ok_work() completion callback, and add FIXME for
transport_lookup_tmr_lun() with se_lun->lun_ref.
Finally, update sbp_update_unit_directory() special case usage with
proper rcu_dereference_raw() and configfs symlink comment.
Reported-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Chris Boot <bootc@bootc.net>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include/target')
-rw-r--r-- | include/target/target_core_base.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h index 1927dd5947a7..b82a989a4d3b 100644 --- a/include/target/target_core_base.h +++ b/include/target/target_core_base.h | |||
@@ -690,9 +690,9 @@ struct se_port_stat_grps { | |||
690 | }; | 690 | }; |
691 | 691 | ||
692 | struct scsi_port_stats { | 692 | struct scsi_port_stats { |
693 | u32 cmd_pdus; | 693 | atomic_long_t cmd_pdus; |
694 | u64 tx_data_octets; | 694 | atomic_long_t tx_data_octets; |
695 | u64 rx_data_octets; | 695 | atomic_long_t rx_data_octets; |
696 | }; | 696 | }; |
697 | 697 | ||
698 | struct se_lun { | 698 | struct se_lun { |
@@ -705,7 +705,6 @@ struct se_lun { | |||
705 | u32 unpacked_lun; | 705 | u32 unpacked_lun; |
706 | u32 lun_index; | 706 | u32 lun_index; |
707 | atomic_t lun_acl_count; | 707 | atomic_t lun_acl_count; |
708 | spinlock_t lun_sep_lock; | ||
709 | struct se_device __rcu *lun_se_dev; | 708 | struct se_device __rcu *lun_se_dev; |
710 | 709 | ||
711 | struct list_head lun_deve_list; | 710 | struct list_head lun_deve_list; |
@@ -818,6 +817,9 @@ struct se_device { | |||
818 | struct se_lun xcopy_lun; | 817 | struct se_lun xcopy_lun; |
819 | /* Protection Information */ | 818 | /* Protection Information */ |
820 | int prot_length; | 819 | int prot_length; |
820 | /* For se_lun->lun_se_dev RCU read-side critical access */ | ||
821 | u32 hba_index; | ||
822 | struct rcu_head rcu_head; | ||
821 | }; | 823 | }; |
822 | 824 | ||
823 | struct se_hba { | 825 | struct se_hba { |