diff options
| author | David S. Miller <davem@davemloft.net> | 2016-02-01 18:44:07 -0800 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2016-02-01 18:44:07 -0800 |
| commit | b45efa30a626e915192a6c548cd8642379cd47cc (patch) | |
| tree | 90d8b43ebceb850b0e7852d75283aebbd2abbc00 /include/linux/idr.h | |
| parent | 7a26019fdecdb45ff784ae4e3b7e0cc9045100ca (diff) | |
| parent | 34229b277480f46c1e9a19f027f30b074512e68b (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'include/linux/idr.h')
| -rw-r--r-- | include/linux/idr.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/idr.h b/include/linux/idr.h index 013fd9bc4cb6..083d61e92706 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h @@ -135,6 +135,20 @@ static inline void *idr_find(struct idr *idr, int id) #define idr_for_each_entry(idp, entry, id) \ for (id = 0; ((entry) = idr_get_next(idp, &(id))) != NULL; ++id) +/** + * idr_for_each_entry - continue iteration over an idr's elements of a given type + * @idp: idr handle + * @entry: the type * to use as cursor + * @id: id entry's key + * + * Continue to iterate over list of given type, continuing after + * the current position. + */ +#define idr_for_each_entry_continue(idp, entry, id) \ + for ((entry) = idr_get_next((idp), &(id)); \ + entry; \ + ++id, (entry) = idr_get_next((idp), &(id))) + /* * IDA - IDR based id allocator, use when translation from id to * pointer isn't necessary. |
