diff options
author | Mike Christie <michael.christie@oracle.com> | 2023-03-18 20:56:13 -0500 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2023-03-24 17:32:23 -0400 |
commit | 4edba7e4a8f39112398d3cda94128a8e13a7d527 (patch) | |
tree | f9ba054f1511293f229e05bf999a801f699fe621 /drivers/target/iscsi | |
parent | becd9be6069e7b183c084f460f0eb363e43cc487 (diff) | |
download | linux-4edba7e4a8f39112398d3cda94128a8e13a7d527.tar.gz linux-4edba7e4a8f39112398d3cda94128a8e13a7d527.tar.bz2 linux-4edba7e4a8f39112398d3cda94128a8e13a7d527.zip |
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/iscsi')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_login.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c index 27e448c2d066..8ab6c0107d89 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c @@ -324,8 +324,18 @@ static int iscsi_login_zero_tsih_s1( goto free_ops; } + /* + * This is temp for iser. It will be moved to per conn in later + * patches for iscsi. + */ + sess->se_sess->cmd_cnt = target_alloc_cmd_counter(); + if (!sess->se_sess->cmd_cnt) + goto free_se_sess; + return 0; +free_se_sess: + transport_free_session(sess->se_sess); free_ops: kfree(sess->sess_ops); free_id: |