diff options
author | Tejun Heo <tj@kernel.org> | 2013-02-27 17:03:53 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-27 19:10:14 -0800 |
commit | 12d1b4393e0d8df36b2646a5e512f0513fb532d2 (patch) | |
tree | a705b06b3d0ece29b0f34fedba87d18543ac1b80 /include/linux/idr.h | |
parent | 49038ef4fbe2842bd4d8338f89ec5c9ba71b0ae1 (diff) | |
download | linux-12d1b4393e0d8df36b2646a5e512f0513fb532d2.tar.gz linux-12d1b4393e0d8df36b2646a5e512f0513fb532d2.tar.bz2 linux-12d1b4393e0d8df36b2646a5e512f0513fb532d2.zip |
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>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/idr.h')
-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 ff44bc83f3cb..837f152b1383 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) |