Some drivers (like i915) may require allocations of contiguous ranges of IDs, while current IDA supports only single ID allocation and does not guarantee that next returned ID will be next to the previous one. Extend implementation of IDA to allow allocation of arbitrary number of contiguous IDs and add some basic KUnit test coverage. Cc: Matthew Wilcox <willy@xxxxxxxxxxxxx> Michal Wajdeczko (3): ida: Introduce ida_weight() ida: Introduce ida_alloc_group_range() ida: Add kunit based tests for new IDA functions include/linux/idr.h | 4 + lib/Kconfig.debug | 12 +++ lib/Makefile | 1 + lib/ida_kunit.c | 140 ++++++++++++++++++++++++++ lib/idr.c | 240 +++++++++++++++++++++++++++++++++++--------- 5 files changed, 351 insertions(+), 46 deletions(-) create mode 100644 lib/ida_kunit.c -- 2.25.1