Files
Matthew Wilcox 302522fb8f idr: Add idr_alloc_u32 helper
All current users of idr_alloc_ext() actually want to allocate a u32
and idr_alloc_u32() fits their needs better.

Like idr_get_next(), it uses a 'nextid' argument which serves as both
a pointer to the start ID and the assigned ID (instead of a separate
minimum and pointer-to-assigned-ID argument).  It uses a 'max' argument
rather than 'end' because the semantics that idr_alloc has for 'end'
don't work well for unsigned types.

Since idr_alloc_u32() returns an errno instead of the allocated ID, mark
it as __must_check to help callers use it correctly.  Include copious
kernel-doc.  Chris Mi <chrism@mellanox.com> has promised to contribute
test-cases for idr_alloc_u32.

Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
Change-Id: Id32ab4ba4c31d1ebb12945fffeb2b7ea7b146b4f
Signed-off-by: Naveen <133593113+elohim-etz@users.noreply.github.com>
2026-01-20 13:45:20 +00:00
..
2017-08-15 09:02:08 -07:00
2017-06-09 11:52:07 +02:00
2019-04-20 09:15:07 +02:00
2017-02-24 17:46:57 -08:00
2026-01-20 13:45:20 +00:00
2023-04-15 20:33:18 +01:00
2020-02-19 10:09:50 +01:00
2017-08-15 09:02:07 -07:00