c49392116d
The Rust-side implementation of Linux's idr_for_each_entry macro. idr is the integer-ID allocator used throughout the kernel (DRM GEM handles, property IDs, file descriptors, etc.). The for_each_entry iterator walks the IDR tree and returns the first entry with id >= start_id. Previously the kernel API was stubbed at the C level. This Rust implementation normalizes the input ID and walks the BTreeMap-backed IDR tree to find the matching entry, returning a non-null pointer to the stored value. Cross-referenced with Linux lib/idr.c: idr_for_each_entry().