summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_transport_iscsi.c
diff options
context:
space:
mode:
authorkeliu <liuke94@huawei.com>2022-05-27 11:30:49 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2022-06-08 04:58:06 +0300
commit3fd3a52ca672fea71ff6ebaded2e2ddbbfb3a397 (patch)
tree0c5de7c781a0e32fbccaf8e3138396c53d7cdc59 /drivers/scsi/scsi_transport_iscsi.c
parenta6e0d179764cb31b2981c85e6fd156adc777e4ed (diff)
downloadlinux-3fd3a52ca672fea71ff6ebaded2e2ddbbfb3a397.tar.xz
scsi: core: iscsi: Directly use ida_alloc()/ida_free()
Use ida_alloc()/ida_free() instead of the deprecated ida_simple_get()/ida_simple_remove() interface. Link: https://lore.kernel.org/r/20220527083049.2552526-1-liuke94@huawei.com Reviewed-by: Mike Christie <michael.christie@oracle.com> Reviewed-by: Lee Duncan <lduncan@suse.com> Signed-off-by: keliu <liuke94@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_transport_iscsi.c')
-rw-r--r--drivers/scsi/scsi_transport_iscsi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c
index 2c0dd64159b0..2578db4c095d 100644
--- a/drivers/scsi/scsi_transport_iscsi.c
+++ b/drivers/scsi/scsi_transport_iscsi.c
@@ -1975,7 +1975,7 @@ static void __iscsi_unbind_session(struct work_struct *work)
scsi_remove_target(&session->dev);
if (session->ida_used)
- ida_simple_remove(&iscsi_sess_ida, target_id);
+ ida_free(&iscsi_sess_ida, target_id);
unbind_session_exit:
iscsi_session_event(session, ISCSI_KEVENT_UNBIND_SESSION);
@@ -2044,7 +2044,7 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
return -ENOMEM;
if (target_id == ISCSI_MAX_TARGET) {
- id = ida_simple_get(&iscsi_sess_ida, 0, 0, GFP_KERNEL);
+ id = ida_alloc(&iscsi_sess_ida, GFP_KERNEL);
if (id < 0) {
iscsi_cls_session_printk(KERN_ERR, session,
@@ -2083,7 +2083,7 @@ release_dev:
device_del(&session->dev);
release_ida:
if (session->ida_used)
- ida_simple_remove(&iscsi_sess_ida, session->target_id);
+ ida_free(&iscsi_sess_ida, session->target_id);
destroy_wq:
destroy_workqueue(session->workq);
return err;