Article 3Y1WQ [$] IDA: simplifying the complex task of allocating integers

[$] IDA: simplifying the complex task of allocating integers

by
corbet
from LWN.net on (#3Y1WQ)
It is common for kernel code to generate unique integers for identifiers.When one plugs in a flash drive, it will show up as/dev/sdN; that N (a letter derived from anumber) must be generated in thekernel, and it should not already be in use for another drive or unpleasantthings will happen. One might think that generating such numbers would notbe a difficult task, but that turns out not to be the case, especially insituations where many numbers must be tracked. The IDA (for "IDallocator", perhaps) API exists to handle this specialized task. In pastkernels, it has managed to make the process of getting an unused numbersurprisingly complex; the 4.19 kernel has a new IDA API that simplifies thingsconsiderably.
External Content
Source RSS or Atom Feed
Feed Location http://lwn.net/headlines/rss
Feed Title LWN.net
Feed Link https://lwn.net/
Reply 0 comments