hrtimer: don't modify restart_block->fn in restart functions

hrtimer_nanosleep_restart() clears/restores restart_block->fn. This is
pointless and complicates its usage. Note that if sys_restart_syscall()
doesn't actually happen, we have a bogus "pending" restart->fn anyway,
this is harmless.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Alexey Dobriyan <adobriyan@sw.ru>
Cc: Pavel Emelyanov <xemul@sw.ru>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Toyo Abe <toyoa@mvista.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

authored by Oleg Nesterov and committed by Thomas Gleixner c289b074 41652937

-5
-1
kernel/compat.c
··· 55 55 set_fs(oldfs); 56 56 57 57 if (ret) { 58 - restart->fn = compat_nanosleep_restart; 59 58 restart->arg1 = (unsigned long)rmtp; 60 59 61 60 if (rmtp && put_compat_timespec(&rmt, rmtp))
-4
kernel/hrtimer.c
··· 1340 1340 struct hrtimer_sleeper t; 1341 1341 struct timespec __user *rmtp; 1342 1342 1343 - restart->fn = do_no_restart_syscall; 1344 - 1345 1343 hrtimer_init(&t.timer, restart->arg0, HRTIMER_MODE_ABS); 1346 1344 t.timer.expires.tv64 = ((u64)restart->arg3 << 32) | (u64) restart->arg2; 1347 1345 ··· 1352 1354 if (ret <= 0) 1353 1355 return ret; 1354 1356 } 1355 - 1356 - restart->fn = hrtimer_nanosleep_restart; 1357 1357 1358 1358 /* The other values in restart are already filled in */ 1359 1359 return -ERESTART_RESTARTBLOCK;