diff options
author | Tejun Heo <tj@kernel.org> | 2013-02-07 12:31:33 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2013-02-14 15:26:18 +1100 |
commit | 08801830b834482cd3ba170f1d27c246d0620130 (patch) | |
tree | 0fd337960e677eacf2848152895e0446812bb7be /include | |
parent | d3deb9bde5a05ffd0684359c1f010a8d132b77e3 (diff) |
idr: remove _idr_rc_to_errno() hack
idr uses -1, IDR_NEED_TO_GROW and IDR_NOMORE_SPACE to communicate
exception conditions internally. The return value is later translated
to errno values using _idr_rc_to_errno().
This is confusing. Drop the custom ones and consistently use -EAGAIN
for "tree needs to grow", -ENOMEM for "need more memory" and -ENOSPC
for "ran out of ID space".
Due to the weird memory preloading mechanism, [ra]_get_new*() return
-EAGAIN on memory shortage, so we need to substitute -ENOMEM w/
-EAGAIN on those interface functions. They'll eventually be cleaned
up and the translations will go away.
This patch doesn't introduce any functional changes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/idr.h | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/include/linux/idr.h b/include/linux/idr.h index 7c0700ce6b8b..92e84f78dfa8 100644 --- a/include/linux/idr.h +++ b/include/linux/idr.h @@ -70,12 +70,6 @@ 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) - /** * DOC: idr sync * idr synchronization (stolen from radix-tree.h) |