]> git.karo-electronics.de Git - karo-tx-linux.git/commit
idr: remove _idr_rc_to_errno() hack
authorTejun Heo <tj@kernel.org>
Wed, 20 Feb 2013 02:16:08 +0000 (13:16 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:53:42 +0000 (16:53 +1100)
commitc53c46e4b7b7c60e7bef86a1196830b4a1358b88
treee79ff25ac7cca81584b0e8bdf76bc0d7c595b549
parent5c2b21947aedb2145f99bef5aad72fcc79739efd
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>
include/linux/idr.h
lib/idr.c