Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

keliu and committed by
Martin K. Petersen
3fd3a52c a6e0d179

+5 -5
+2 -2
drivers/scsi/hosts.c
··· 350 350 351 351 kfree(shost->shost_data); 352 352 353 - ida_simple_remove(&host_index_ida, shost->host_no); 353 + ida_free(&host_index_ida, shost->host_no); 354 354 355 355 if (shost->shost_state != SHOST_CREATED) 356 356 put_device(parent); ··· 395 395 init_waitqueue_head(&shost->host_wait); 396 396 mutex_init(&shost->scan_mutex); 397 397 398 - index = ida_simple_get(&host_index_ida, 0, 0, GFP_KERNEL); 398 + index = ida_alloc(&host_index_ida, GFP_KERNEL); 399 399 if (index < 0) { 400 400 kfree(shost); 401 401 return NULL;
+3 -3
drivers/scsi/scsi_transport_iscsi.c
··· 1975 1975 scsi_remove_target(&session->dev); 1976 1976 1977 1977 if (session->ida_used) 1978 - ida_simple_remove(&iscsi_sess_ida, target_id); 1978 + ida_free(&iscsi_sess_ida, target_id); 1979 1979 1980 1980 unbind_session_exit: 1981 1981 iscsi_session_event(session, ISCSI_KEVENT_UNBIND_SESSION); ··· 2044 2044 return -ENOMEM; 2045 2045 2046 2046 if (target_id == ISCSI_MAX_TARGET) { 2047 - id = ida_simple_get(&iscsi_sess_ida, 0, 0, GFP_KERNEL); 2047 + id = ida_alloc(&iscsi_sess_ida, GFP_KERNEL); 2048 2048 2049 2049 if (id < 0) { 2050 2050 iscsi_cls_session_printk(KERN_ERR, session, ··· 2083 2083 device_del(&session->dev); 2084 2084 release_ida: 2085 2085 if (session->ida_used) 2086 - ida_simple_remove(&iscsi_sess_ida, session->target_id); 2086 + ida_free(&iscsi_sess_ida, session->target_id); 2087 2087 destroy_wq: 2088 2088 destroy_workqueue(session->workq); 2089 2089 return err;