Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359376
b: refs/heads/master
c: ee94d52
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent edb997b commit 036a86c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0e9c3be20d88aa5ed13fde4ece50f45eb96824ad
refs/heads/master: ee94d523bf92d3b8b2de166943d48ac7fd695e10
18 changes: 8 additions & 10 deletions trunk/kernel/posix-timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,24 +552,22 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
return -EAGAIN;

spin_lock_init(&new_timer->it_lock);
retry:
if (unlikely(!idr_pre_get(&posix_timers_id, GFP_KERNEL))) {
error = -EAGAIN;
goto out;
}

idr_preload(GFP_KERNEL);
spin_lock_irq(&idr_lock);
error = idr_get_new(&posix_timers_id, new_timer, &new_timer_id);
error = idr_alloc(&posix_timers_id, new_timer, 0, 0, GFP_NOWAIT);
spin_unlock_irq(&idr_lock);
if (error) {
if (error == -EAGAIN)
goto retry;
idr_preload_end();
if (error < 0) {
/*
* Weird looking, but we return EAGAIN if the IDR is
* full (proper POSIX return value for this)
*/
error = -EAGAIN;
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;
Expand Down

0 comments on commit 036a86c

Please sign in to comment.