summaryrefslogtreecommitdiffstats
path: root/include/linux/idr.h
diff options
context:
space:
mode:
authorNadia Derbey <Nadia.Derbey@bull.net>2008-07-25 01:47:59 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 10:53:41 -0700
commit944ca05c7b4972f2ebf37262e0f4933d178ad6db (patch)
tree5fb7558b8247bb56b7c1781808e7eaf08e8fff4e /include/linux/idr.h
parentf098ad655f4dd8e3da98ffbeda9cedcc4459c01a (diff)
idr: error checking factorization
Do some code factorization in the return code analysis. Signed-off-by: Nadia Derbey <Nadia.Derbey@bull.net> Cc: "Paul E. McKenney" <paulmck@us.ibm.com> Cc: Manfred Spraul <manfred@colorfullife.com> Cc: Jim Houston <jim.houston@comcast.net> Cc: Pierre Peiffer <peifferp@gmail.com> Acked-by: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/idr.h')
-rw-r--r--include/linux/idr.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 1af61d23be3..762c3f2c631 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -73,6 +73,12 @@ struct idr {
}
#define DEFINE_IDR(name) struct idr name = IDR_INIT(name)
+/* Actions to be taken after a call to _idr_sub_alloc */
+#define IDR_NEED_TO_GROW -2
+#define IDR_NOMORE_SPACE -3
+
+#define _idr_rc_to_errno(rc) ((rc) == -1 ? -EAGAIN : -ENOSPC)
+
/*
* This is what we export.
*/