aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/idr.h
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2014-08-28 13:31:14 +0200
committerJens Axboe <axboe@fb.com>2015-11-25 09:22:00 -0700
commita55bbd375d1802141f0f043e2cd08f85c23d6209 (patch)
tree83d293e01c9576076f02c53e16da0401a699baa3 /include/linux/idr.h
parentdrbd: Backport the "events2" command (diff)
downloadlinux-dev-a55bbd375d1802141f0f043e2cd08f85c23d6209.tar.xz
linux-dev-a55bbd375d1802141f0f043e2cd08f85c23d6209.zip
drbd: Backport the "status" command
The status command originates the drbd9 code base. While for now we keep the status information in /proc/drbd available, this commit allows the user base to gracefully migrate their monitoring infrastructure to the new status reporting interface. In drbd9 no status information is exposed through /proc/drbd. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'include/linux/idr.h')
-rw-r--r--include/linux/idr.h14
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.