posix-timers: sys_timer_create: simplify and s/tasklist/rcu/
authorOleg Nesterov <oleg@tv-sign.ru>
Mon, 22 Sep 2008 21:42:48 +0000 (14:42 -0700)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 24 Sep 2008 13:45:48 +0000 (15:45 +0200)
commit36b2f046000b358b62b9d116cb10a2b1c5be5cbf
tree577f367d2408d6ed2618d49f412afa91bcb915e8
parent2cd499e38ec241691e4bce50bddc8f57e4cc9bd0
posix-timers: sys_timer_create: simplify and s/tasklist/rcu/

- Change the code to do rcu_read_lock() instead of taking tasklist_lock,
  it is safe to get_task_struct(p) if p was found under RCU.

  However, now we must not use process's sighand/signal, they may be NULL.
  We can use current->sighand/signal instead, this "process" must belong
  to the current's thread-group.

- Factor out the common code for 2 "if (timer_event_spec)" branches, the
  !timer_event_spec case can use current too.

- use spin_lock_irq() instead of _irqsave(), kill "flags".

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: mingo@elte.hu
Cc: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/posix-timers.c