idr: make ida_simple_remove() return an error
authorJens Axboe <axboe@fb.com>
Wed, 2 Mar 2016 16:54:59 +0000 (09:54 -0700)
committerJens Axboe <axboe@fb.com>
Mon, 7 Mar 2016 15:30:49 +0000 (08:30 -0700)
commitce432af9e85ddb79305dd31ff5a5a165a14cbd7e
tree11ffd79e21071dab8c8ace427c9246c82919db84
parentf6cede5b49e822ebc41a099fe41ab4989f64e2cb
idr: make ida_simple_remove() return an error

The idr interface is pretty horrible, in that it doesn't return an
error if we attempt to free an invalid ID, instead it calls
WARN(). That's not great if we're potentially exposing this as a
user visible interface, indirectly.

So add __ida_remove() that returns an error instead of warning,
and change ida_simple_remove() to use that interface. Alternatively
we could make ida_remove() return an error, but then I'd have to
verify all call sites...

Signed-off-by: Jens Axboe <axboe@fb.com>
include/linux/idr.h
lib/idr.c