Re: [PATCH] lib: add idr_for_each()

2007-06-01 Thread Stefan Richter
Kristian Høgsberg wrote: > /** > + * idr_for_each - iterate through all stored pointers ... > + * The caller must serialize idr_find() vs idr_get_new() and idr_remove(). > + */ > +int idr_for_each(struct idr *idp, > + int (*fn)(int id, void

[PATCH] lib: add idr_for_each()

2007-06-01 Thread Kristian Høgsberg
This patch adds an iterator function for the idr data structure. Compared to just iterating through the idr with an integer and idr_find, this iterator is (almost, but not quite) linear in the number of elements, as opposed to the number of integers in the range covered by the idr. This makes a

[PATCH] lib: add idr_for_each()

2007-06-01 Thread Kristian Høgsberg
This patch adds an iterator function for the idr data structure. Compared to just iterating through the idr with an integer and idr_find, this iterator is (almost, but not quite) linear in the number of elements, as opposed to the number of integers in the range covered by the idr. This makes a

Re: [PATCH] lib: add idr_for_each()

2007-06-01 Thread Stefan Richter
Kristian Høgsberg wrote: /** + * idr_for_each - iterate through all stored pointers ... + * The caller must serialize idr_find() vs idr_get_new() and idr_remove(). + */ +int idr_for_each(struct idr *idp, + int (*fn)(int id, void *p, void