From: Christophe JAILLET Date: Sat, 8 Jun 2024 14:34:20 +0000 (+0200) Subject: proc: remove usage of the deprecated ida_simple_xx() API X-Git-Tag: v6.11-rc1~84^2~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cda1c8e0c33d3e06ef8e912ab1b16f00e4d5d088;p=thirdparty%2Fkernel%2Flinux.git proc: remove usage of the deprecated ida_simple_xx() API ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_max() is inclusive. So a -1 has been added when needed. Link: https://lkml.kernel.org/r/ae10003feb87d240163d0854de95f09e1f00be7d.1717855701.git.christophe.jaillet@wanadoo.fr Signed-off-by: Christophe JAILLET Reviewed-by: Matthew Wilcox (Oracle) Cc: Alexey Dobriyan Cc: Alistar Popple Cc: Christian Gromm Cc: Eddie James Cc: Jeremy Kerr Cc: Joel Stanley Cc: Parthiban Veerasooran Signed-off-by: Andrew Morton --- diff --git a/fs/proc/generic.c b/fs/proc/generic.c index 775ce0bcf08ce..c02f1e63f82d0 100644 --- a/fs/proc/generic.c +++ b/fs/proc/generic.c @@ -202,8 +202,8 @@ int proc_alloc_inum(unsigned int *inum) { int i; - i = ida_simple_get(&proc_inum_ida, 0, UINT_MAX - PROC_DYNAMIC_FIRST + 1, - GFP_KERNEL); + i = ida_alloc_max(&proc_inum_ida, UINT_MAX - PROC_DYNAMIC_FIRST, + GFP_KERNEL); if (i < 0) return i; @@ -213,7 +213,7 @@ int proc_alloc_inum(unsigned int *inum) void proc_free_inum(unsigned int inum) { - ida_simple_remove(&proc_inum_ida, inum - PROC_DYNAMIC_FIRST); + ida_free(&proc_inum_ida, inum - PROC_DYNAMIC_FIRST); } static int proc_misc_d_revalidate(struct dentry *dentry, unsigned int flags)