* [PATCH] drivers: scsi: Directly use ida_alloc()/free()
@ 2022-05-27 8:30 keliu
2022-05-27 15:56 ` michael.christie
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: keliu @ 2022-05-27 8:30 UTC (permalink / raw)
To: jejb, martin.petersen, lduncan, cleech, michael.christie,
linux-scsi, linux-kernel, open-iscsi
Cc: keliu
Use ida_alloc()/ida_free() instead of deprecated
ida_simple_get()/ida_simple_remove() .
Signed-off-by: keliu <liuke94@huawei.com>
---
drivers/scsi/hosts.c | 4 ++--
drivers/scsi/scsi_transport_iscsi.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index f69b77cbf538..ec16cfad034e 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -350,7 +350,7 @@ static void scsi_host_dev_release(struct device *dev)
kfree(shost->shost_data);
- ida_simple_remove(&host_index_ida, shost->host_no);
+ ida_free(&host_index_ida, shost->host_no);
if (shost->shost_state != SHOST_CREATED)
put_device(parent);
@@ -395,7 +395,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
init_waitqueue_head(&shost->host_wait);
mutex_init(&shost->scan_mutex);
- index = ida_simple_get(&host_index_ida, 0, 0, GFP_KERNEL);
+ index = ida_alloc(&host_index_ida, GFP_KERNEL);
if (index < 0) {
kfree(shost);
return NULL;
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 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
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;
--
2.25.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drivers: scsi: Directly use ida_alloc()/free()
2022-05-27 8:30 [PATCH] drivers: scsi: Directly use ida_alloc()/free() keliu
@ 2022-05-27 15:56 ` michael.christie
2022-05-30 16:39 ` Lee Duncan
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: michael.christie @ 2022-05-27 15:56 UTC (permalink / raw)
To: keliu, jejb, martin.petersen, lduncan, cleech, linux-scsi,
linux-kernel, open-iscsi
On 5/27/22 3:30 AM, keliu wrote:
> Use ida_alloc()/ida_free() instead of deprecated
> ida_simple_get()/ida_simple_remove() .
>
> Signed-off-by: keliu <liuke94@huawei.com>
> ---
> drivers/scsi/hosts.c | 4 ++--
> drivers/scsi/scsi_transport_iscsi.c | 6 +++---
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drivers: scsi: Directly use ida_alloc()/free()
2022-05-27 8:30 [PATCH] drivers: scsi: Directly use ida_alloc()/free() keliu
2022-05-27 15:56 ` michael.christie
@ 2022-05-30 16:39 ` Lee Duncan
2022-06-08 1:58 ` Martin K. Petersen
2022-06-10 17:45 ` Martin K. Petersen
3 siblings, 0 replies; 5+ messages in thread
From: Lee Duncan @ 2022-05-30 16:39 UTC (permalink / raw)
To: keliu, jejb, martin.petersen, cleech, michael.christie,
linux-scsi, linux-kernel, open-iscsi
On 5/27/22 01:30, keliu wrote:
> Use ida_alloc()/ida_free() instead of deprecated
> ida_simple_get()/ida_simple_remove() .
>
> Signed-off-by: keliu <liuke94@huawei.com>
> ---
> drivers/scsi/hosts.c | 4 ++--
> drivers/scsi/scsi_transport_iscsi.c | 6 +++---
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
> index f69b77cbf538..ec16cfad034e 100644
> --- a/drivers/scsi/hosts.c
> +++ b/drivers/scsi/hosts.c
> @@ -350,7 +350,7 @@ static void scsi_host_dev_release(struct device *dev)
>
> kfree(shost->shost_data);
>
> - ida_simple_remove(&host_index_ida, shost->host_no);
> + ida_free(&host_index_ida, shost->host_no);
>
> if (shost->shost_state != SHOST_CREATED)
> put_device(parent);
> @@ -395,7 +395,7 @@ struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *sht, int privsize)
> init_waitqueue_head(&shost->host_wait);
> mutex_init(&shost->scan_mutex);
>
> - index = ida_simple_get(&host_index_ida, 0, 0, GFP_KERNEL);
> + index = ida_alloc(&host_index_ida, GFP_KERNEL);
> if (index < 0) {
> kfree(shost);
> return NULL;
> 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 @@ int iscsi_add_session(struct iscsi_cls_session *session, unsigned int target_id)
> 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;
Reviewed-by: Lee Duncan <lduncan@suse.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drivers: scsi: Directly use ida_alloc()/free()
2022-05-27 8:30 [PATCH] drivers: scsi: Directly use ida_alloc()/free() keliu
2022-05-27 15:56 ` michael.christie
2022-05-30 16:39 ` Lee Duncan
@ 2022-06-08 1:58 ` Martin K. Petersen
2022-06-10 17:45 ` Martin K. Petersen
3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2022-06-08 1:58 UTC (permalink / raw)
To: keliu
Cc: jejb, martin.petersen, lduncan, cleech, michael.christie,
linux-scsi, linux-kernel, open-iscsi
keliu,
> Use ida_alloc()/ida_free() instead of deprecated
> ida_simple_get()/ida_simple_remove() .
Applied to 5.20/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drivers: scsi: Directly use ida_alloc()/free()
2022-05-27 8:30 [PATCH] drivers: scsi: Directly use ida_alloc()/free() keliu
` (2 preceding siblings ...)
2022-06-08 1:58 ` Martin K. Petersen
@ 2022-06-10 17:45 ` Martin K. Petersen
3 siblings, 0 replies; 5+ messages in thread
From: Martin K. Petersen @ 2022-06-10 17:45 UTC (permalink / raw)
To: linux-scsi, cleech, open-iscsi, lduncan, linux-kernel, keliu,
jejb, michael.christie
Cc: Martin K . Petersen
On Fri, 27 May 2022 08:30:49 +0000, keliu wrote:
> Use ida_alloc()/ida_free() instead of deprecated
> ida_simple_get()/ida_simple_remove() .
>
>
Applied to 5.20/scsi-queue, thanks!
[1/1] drivers: scsi: Directly use ida_alloc()/free()
https://git.kernel.org/mkp/scsi/c/3fd3a52ca672
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-06-10 17:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-27 8:30 [PATCH] drivers: scsi: Directly use ida_alloc()/free() keliu
2022-05-27 15:56 ` michael.christie
2022-05-30 16:39 ` Lee Duncan
2022-06-08 1:58 ` Martin K. Petersen
2022-06-10 17:45 ` Martin K. Petersen
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.