aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2013-11-07 00:03:43 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2013-11-07 17:24:52 -0500
commit5277797dc4ed873d067477d84e910b39d113f649 (patch)
tree5e2aa87dec2cbcb5bbdfadd697c92e86b0e5aa11 /include
parentc9e8d128fe316751230ee0c53478740c64f58436 (diff)
target: Add percpu refcounting for se_lun access
This patch adds percpu refcounting for se_lun access that allows the association of an se_lun + se_cmd in transport_lookup_cmd_lun() to occur without an extra list_head for tracking outstanding I/O during se_lun shutdown. This effectively changes se_lun shutdown logic to wait for outstanding I/O percpu references to complete in transport_lun_remove_cmd() using se_lun->lun_ref_comp, instead of explicitly draining the per se_lun command list and waiting for individual se_cmd descriptor processing to complete. Cc: Kent Overstreet <kmo@daterainc.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include')
-rw-r--r--include/target/target_core_base.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 22e752c4406d..4d16fd9330a6 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -499,6 +499,9 @@ struct se_cmd {
499 499
500 /* backend private data */ 500 /* backend private data */
501 void *priv; 501 void *priv;
502
503 /* Used for lun->lun_ref counting */
504 bool lun_ref_active;
502}; 505};
503 506
504struct se_ua { 507struct se_ua {
@@ -757,6 +760,8 @@ struct se_lun {
757 struct se_port *lun_sep; 760 struct se_port *lun_sep;
758 struct config_group lun_group; 761 struct config_group lun_group;
759 struct se_port_stat_grps port_stat_grps; 762 struct se_port_stat_grps port_stat_grps;
763 struct completion lun_ref_comp;
764 struct percpu_ref lun_ref;
760}; 765};
761 766
762struct scsi_port_stats { 767struct scsi_port_stats {