Commit ee94d523 authored by Tejun Heo's avatar Tejun Heo Committed by Linus Torvalds
Browse files

posix-timers: convert to idr_alloc()

Convert to the much saner new idr interface.
Signed-off-by: default avatarTejun Heo <>
Cc: Thomas Gleixner <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 0e9c3be2
......@@ -552,24 +552,22 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
return -EAGAIN;
if (unlikely(!idr_pre_get(&posix_timers_id, GFP_KERNEL))) {
error = -EAGAIN;
goto out;
error = idr_get_new(&posix_timers_id, new_timer, &new_timer_id);
error = idr_alloc(&posix_timers_id, new_timer, 0, 0, GFP_NOWAIT);
if (error) {
if (error == -EAGAIN)
goto retry;
if (error < 0) {
* Weird looking, but we return EAGAIN if the IDR is
* full (proper POSIX return value for this)
if (error == -ENOSPC)
error = -EAGAIN;
goto out;
new_timer_id = error;
it_id_set = IT_ID_SET;
new_timer->it_id = (timer_t) new_timer_id;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment