summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_xcopy.c
diff options
context:
space:
mode:
authorMike Christie <michael.christie@oracle.com>2023-03-19 04:56:13 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2023-03-25 00:32:23 +0300
commit4edba7e4a8f39112398d3cda94128a8e13a7d527 (patch)
treef9ba054f1511293f229e05bf999a801f699fe621 /drivers/target/target_core_xcopy.c
parentbecd9be6069e7b183c084f460f0eb363e43cc487 (diff)
downloadlinux-4edba7e4a8f39112398d3cda94128a8e13a7d527.tar.xz
scsi: target: Move cmd counter allocation
iSCSI needs to allocate its cmd counter per connection for MCS support where we need to stop and wait on commands running on a connection instead of per session. This moves the cmd counter allocation to target_setup_session() which is used by drivers that need the stop+wait behavior per session. xcopy doesn't need stop+wait at all, so we will be OK moving the cmd counter allocation outside of transport_init_session(). Signed-off-by: Mike Christie <michael.christie@oracle.com> Link: https://lore.kernel.org/r/20230319015620.96006-3-michael.christie@oracle.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target/target_core_xcopy.c')
-rw-r--r--drivers/target/target_core_xcopy.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c
index 49eaee022ef1..49a83500c8b7 100644
--- a/drivers/target/target_core_xcopy.c
+++ b/drivers/target/target_core_xcopy.c
@@ -461,8 +461,6 @@ static const struct target_core_fabric_ops xcopy_pt_tfo = {
int target_xcopy_setup_pt(void)
{
- int ret;
-
xcopy_wq = alloc_workqueue("xcopy_wq", WQ_MEM_RECLAIM, 0);
if (!xcopy_wq) {
pr_err("Unable to allocate xcopy_wq\n");
@@ -479,9 +477,7 @@ int target_xcopy_setup_pt(void)
INIT_LIST_HEAD(&xcopy_pt_nacl.acl_list);
INIT_LIST_HEAD(&xcopy_pt_nacl.acl_sess_list);
memset(&xcopy_pt_sess, 0, sizeof(struct se_session));
- ret = transport_init_session(&xcopy_pt_sess);
- if (ret < 0)
- goto destroy_wq;
+ transport_init_session(&xcopy_pt_sess);
xcopy_pt_nacl.se_tpg = &xcopy_pt_tpg;
xcopy_pt_nacl.nacl_sess = &xcopy_pt_sess;
@@ -490,19 +486,12 @@ int target_xcopy_setup_pt(void)
xcopy_pt_sess.se_node_acl = &xcopy_pt_nacl;
return 0;
-
-destroy_wq:
- destroy_workqueue(xcopy_wq);
- xcopy_wq = NULL;
- return ret;
}
void target_xcopy_release_pt(void)
{
- if (xcopy_wq) {
+ if (xcopy_wq)
destroy_workqueue(xcopy_wq);
- transport_uninit_session(&xcopy_pt_sess);
- }
}
/*