1IDR_FOR_EACH(9) Basic Kernel Library Functions IDR_FOR_EACH(9)
2
3
4
6 idr_for_each - iterate through all stored pointers
7
9 int idr_for_each(struct idr * idp,
10 int (*fn) (int id, void *p, void *data), void * data);
11
13 idp
14 idr handle
15
16 fn
17 function to be called for each pointer
18
19 data
20 data passed back to callback function
21
23 Iterate over the pointers registered with the given idr. The callback
24 function will be called for each pointer currently registered, passing
25 the id, the pointer and the data pointer passed to this function. It is
26 not safe to modify the idr tree while in the callback, so functions
27 such as idr_get_new and idr_remove are not allowed.
28
29 We check the return of fn each time. If it returns anything other than
30 0, we break out and return that value.
31
32 The caller must serialize idr_for_each vs idr_get_new and idr_remove.
33
35Kernel Hackers Manual 3.10 June 2019 IDR_FOR_EACH(9)