alarmtimer: Move copyout and freeze handling into alarmtimer_do_nsleep()
authorAl Viro <viro@ZenIV.linux.org.uk>
Wed, 7 Jun 2017 08:42:27 +0000 (09:42 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Tue, 13 Jun 2017 22:00:40 +0000 (00:00 +0200)
commit15f27ce24cb613e6e01ce27c4094c55e55dde5d4
tree8fbbecce0be3837fcea78d9854c8d04d3f6d4441
parent86a9c446c13ecd8793ea8599761322aed125d542
alarmtimer: Move copyout and freeze handling into alarmtimer_do_nsleep()

The alarmtimer nanosleep() implementation can be simplified by moving the
copy out of the remaining time to alarmtimer_do_nsleep() which is shared
between the real nanosleep function and the restart function.

The pointer to the timespec64 which is updated has to be stored in the
restart block anyway. Instead of storing it only in the restart case, store
it before calling alarmtimer_do_nsleep() and copy the remaining time in the
signal exit path.

[ tglx: Added changelog ]

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20170607084241.28657-2-viro@ZenIV.linux.org.uk
kernel/time/alarmtimer.c