summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_xcopy.c
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2013-11-06 21:03:43 -0800
committerNicholas Bellinger <nab@linux-iscsi.org>2013-11-07 14:24:52 -0800
commit5277797dc4ed873d067477d84e910b39d113f649 (patch)
tree5e2aa87dec2cbcb5bbdfadd697c92e86b0e5aa11 /drivers/target/target_core_xcopy.c
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 'drivers/target/target_core_xcopy.c')
-rw-r--r--drivers/target/target_core_xcopy.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c
index 4d22e7d2adca..7a870f6add7b 100644
--- a/drivers/target/target_core_xcopy.c
+++ b/drivers/target/target_core_xcopy.c
@@ -579,6 +579,7 @@ static int target_xcopy_init_pt_lun(
spin_lock_init(&pt_cmd->se_lun->lun_acl_lock);
spin_lock_init(&pt_cmd->se_lun->lun_cmd_lock);
spin_lock_init(&pt_cmd->se_lun->lun_sep_lock);
+ init_completion(&pt_cmd->se_lun->lun_ref_comp);
pt_cmd->se_dev = se_dev;