diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-09 17:18:43 +0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-09 17:20:23 +0400 |
commit | 986836503e49ccf7e84b813715d344964ec93566 (patch) | |
tree | b3bea7428efde5b77096cef80e5b6bfee494cc12 /include/linux/idr.h | |
parent | ccae7868b0c5697508a541c531cf96b361d62c1c (diff) | |
parent | 328e0f125bf41f4f33f684db22015f92cb44fe56 (diff) | |
download | linux-986836503e49ccf7e84b813715d344964ec93566.tar.xz |
Merge branch 'drbd-8.4_ed6' into for-3.8-drivers-drbd-8.4_ed6
Diffstat (limited to 'include/linux/idr.h')
-rw-r--r-- | include/linux/idr.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/idr.h b/include/linux/idr.h index 87259a44c251..de7e190f1af4 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h @@ -152,4 +152,15 @@ void ida_simple_remove(struct ida *ida, unsigned int id); void __init idr_init_cache(void); +/** + * idr_for_each_entry - iterate over an idr's elements of a given type + * @idp: idr handle + * @entry: the type * to use as cursor + * @id: id entry's key + */ +#define idr_for_each_entry(idp, entry, id) \ + for (id = 0, entry = (typeof(entry))idr_get_next((idp), &(id)); \ + entry != NULL; \ + ++id, entry = (typeof(entry))idr_get_next((idp), &(id))) + #endif /* __IDR_H__ */ |