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.

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 <christophe.jaillet@wanadoo.fr>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Alistar Popple <alistair@popple.id.au>
Cc: Christian Gromm <christian.gromm@microchip.com>
Cc: Eddie James <eajames@linux.ibm.com>
Cc: Jeremy Kerr <jk@ozlabs.org>
Cc: Joel Stanley <joel@jms.id.au>
Cc: Parthiban Veerasooran <parthiban.veerasooran@microchip.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Christophe JAILLET and committed by
Andrew Morton
cda1c8e0 b737a221

+3 -3
+3 -3
fs/proc/generic.c
··· 202 202 { 203 203 int i; 204 204 205 - i = ida_simple_get(&proc_inum_ida, 0, UINT_MAX - PROC_DYNAMIC_FIRST + 1, 206 - GFP_KERNEL); 205 + i = ida_alloc_max(&proc_inum_ida, UINT_MAX - PROC_DYNAMIC_FIRST, 206 + GFP_KERNEL); 207 207 if (i < 0) 208 208 return i; 209 209 ··· 213 213 214 214 void proc_free_inum(unsigned int inum) 215 215 { 216 - ida_simple_remove(&proc_inum_ida, inum - PROC_DYNAMIC_FIRST); 216 + ida_free(&proc_inum_ida, inum - PROC_DYNAMIC_FIRST); 217 217 } 218 218 219 219 static int proc_misc_d_revalidate(struct dentry *dentry, unsigned int flags)