* [PATCH] vboxsf: Remove usage of the deprecated ida_simple_xx() API
@ 2023-12-19 5:17 Christophe JAILLET
2023-12-19 5:19 ` Matthew Wilcox
2023-12-19 9:39 ` Hans de Goede
0 siblings, 2 replies; 4+ messages in thread
From: Christophe JAILLET @ 2023-12-19 5:17 UTC (permalink / raw)
To: Hans de Goede
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-fsdevel
ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().
This is less verbose.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
fs/vboxsf/super.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c
index 1fb8f4df60cb..cd8486bc91bd 100644
--- a/fs/vboxsf/super.c
+++ b/fs/vboxsf/super.c
@@ -155,7 +155,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
}
}
- sbi->bdi_id = ida_simple_get(&vboxsf_bdi_ida, 0, 0, GFP_KERNEL);
+ sbi->bdi_id = ida_alloc(&vboxsf_bdi_ida, GFP_KERNEL);
if (sbi->bdi_id < 0) {
err = sbi->bdi_id;
goto fail_free;
@@ -221,7 +221,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
vboxsf_unmap_folder(sbi->root);
fail_free:
if (sbi->bdi_id >= 0)
- ida_simple_remove(&vboxsf_bdi_ida, sbi->bdi_id);
+ ida_free(&vboxsf_bdi_ida, sbi->bdi_id);
if (sbi->nls)
unload_nls(sbi->nls);
idr_destroy(&sbi->ino_idr);
@@ -268,7 +268,7 @@ static void vboxsf_put_super(struct super_block *sb)
vboxsf_unmap_folder(sbi->root);
if (sbi->bdi_id >= 0)
- ida_simple_remove(&vboxsf_bdi_ida, sbi->bdi_id);
+ ida_free(&vboxsf_bdi_ida, sbi->bdi_id);
if (sbi->nls)
unload_nls(sbi->nls);
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] vboxsf: Remove usage of the deprecated ida_simple_xx() API
2023-12-19 5:17 [PATCH] vboxsf: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
@ 2023-12-19 5:19 ` Matthew Wilcox
2023-12-19 9:39 ` Hans de Goede
1 sibling, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2023-12-19 5:19 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Hans de Goede, linux-kernel, kernel-janitors, linux-fsdevel
On Tue, Dec 19, 2023 at 06:17:04AM +0100, Christophe JAILLET wrote:
> ida_alloc() and ida_free() should be preferred to the deprecated
> ida_simple_get() and ida_simple_remove().
>
> This is less verbose.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] vboxsf: Remove usage of the deprecated ida_simple_xx() API
2023-12-19 5:17 [PATCH] vboxsf: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2023-12-19 5:19 ` Matthew Wilcox
@ 2023-12-19 9:39 ` Hans de Goede
2024-01-04 14:20 ` Christophe JAILLET
1 sibling, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2023-12-19 9:39 UTC (permalink / raw)
To: Christophe JAILLET; +Cc: linux-kernel, kernel-janitors, linux-fsdevel
Hi,
On 12/19/23 06:17, Christophe JAILLET wrote:
> ida_alloc() and ida_free() should be preferred to the deprecated
> ida_simple_get() and ida_simple_remove().
>
> This is less verbose.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
vboxsf is not really undergoing any active development,
if there is a tree which is collecting other ida related
patches feel free to route this through that tree.
Regards,
Hans
> ---
> fs/vboxsf/super.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c
> index 1fb8f4df60cb..cd8486bc91bd 100644
> --- a/fs/vboxsf/super.c
> +++ b/fs/vboxsf/super.c
> @@ -155,7 +155,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
> }
> }
>
> - sbi->bdi_id = ida_simple_get(&vboxsf_bdi_ida, 0, 0, GFP_KERNEL);
> + sbi->bdi_id = ida_alloc(&vboxsf_bdi_ida, GFP_KERNEL);
> if (sbi->bdi_id < 0) {
> err = sbi->bdi_id;
> goto fail_free;
> @@ -221,7 +221,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
> vboxsf_unmap_folder(sbi->root);
> fail_free:
> if (sbi->bdi_id >= 0)
> - ida_simple_remove(&vboxsf_bdi_ida, sbi->bdi_id);
> + ida_free(&vboxsf_bdi_ida, sbi->bdi_id);
> if (sbi->nls)
> unload_nls(sbi->nls);
> idr_destroy(&sbi->ino_idr);
> @@ -268,7 +268,7 @@ static void vboxsf_put_super(struct super_block *sb)
>
> vboxsf_unmap_folder(sbi->root);
> if (sbi->bdi_id >= 0)
> - ida_simple_remove(&vboxsf_bdi_ida, sbi->bdi_id);
> + ida_free(&vboxsf_bdi_ida, sbi->bdi_id);
> if (sbi->nls)
> unload_nls(sbi->nls);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] vboxsf: Remove usage of the deprecated ida_simple_xx() API
2023-12-19 9:39 ` Hans de Goede
@ 2024-01-04 14:20 ` Christophe JAILLET
0 siblings, 0 replies; 4+ messages in thread
From: Christophe JAILLET @ 2024-01-04 14:20 UTC (permalink / raw)
To: Hans de Goede; +Cc: linux-kernel, kernel-janitors, linux-fsdevel
Le 19/12/2023 à 10:39, Hans de Goede a écrit :
> Hi,
>
> On 12/19/23 06:17, Christophe JAILLET wrote:
>> ida_alloc() and ida_free() should be preferred to the deprecated
>> ida_simple_get() and ida_simple_remove().
>>
>> This is less verbose.
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>
> Thanks, patch looks good to me:
>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>
> vboxsf is not really undergoing any active development,
> if there is a tree which is collecting other ida related
> patches feel free to route this through that tree.
There is still a bit of work to remove the remaining ida_simple_get()
calls, so we still have time.
Based on another experience when phasing out an old API, I would say at
least 2-3 months.
If this one is still around when nearly all the other calls have been
handled, i'll come back to it to see the best way to have is merged in a
tree or in another, so that the old API can be removed.
CJ
>
> Regards,
>
> Hans
>
>
>
>
>
>
>
>> ---
>> fs/vboxsf/super.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c
>> index 1fb8f4df60cb..cd8486bc91bd 100644
>> --- a/fs/vboxsf/super.c
>> +++ b/fs/vboxsf/super.c
>> @@ -155,7 +155,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
>> }
>> }
>>
>> - sbi->bdi_id = ida_simple_get(&vboxsf_bdi_ida, 0, 0, GFP_KERNEL);
>> + sbi->bdi_id = ida_alloc(&vboxsf_bdi_ida, GFP_KERNEL);
>> if (sbi->bdi_id < 0) {
>> err = sbi->bdi_id;
>> goto fail_free;
>> @@ -221,7 +221,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
>> vboxsf_unmap_folder(sbi->root);
>> fail_free:
>> if (sbi->bdi_id >= 0)
>> - ida_simple_remove(&vboxsf_bdi_ida, sbi->bdi_id);
>> + ida_free(&vboxsf_bdi_ida, sbi->bdi_id);
>> if (sbi->nls)
>> unload_nls(sbi->nls);
>> idr_destroy(&sbi->ino_idr);
>> @@ -268,7 +268,7 @@ static void vboxsf_put_super(struct super_block *sb)
>>
>> vboxsf_unmap_folder(sbi->root);
>> if (sbi->bdi_id >= 0)
>> - ida_simple_remove(&vboxsf_bdi_ida, sbi->bdi_id);
>> + ida_free(&vboxsf_bdi_ida, sbi->bdi_id);
>> if (sbi->nls)
>> unload_nls(sbi->nls);
>>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-01-04 14:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-19 5:17 [PATCH] vboxsf: Remove usage of the deprecated ida_simple_xx() API Christophe JAILLET
2023-12-19 5:19 ` Matthew Wilcox
2023-12-19 9:39 ` Hans de Goede
2024-01-04 14:20 ` Christophe JAILLET
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).