Skip to content

Commit

Permalink
hrtimer: don't modify restart_block->fn in restart functions
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Cc: Pavel Emelyanov <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Toyo Abe <[email protected]>
Cc: Andrew Morton <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
  • Loading branch information
Oleg Nesterov authored and KAGA-KOKO committed Feb 10, 2008
1 parent 4165293 commit c289b07
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
1 change: 0 additions & 1 deletion kernel/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ static long compat_nanosleep_restart(struct restart_block *restart)
set_fs(oldfs);

if (ret) {
restart->fn = compat_nanosleep_restart;
restart->arg1 = (unsigned long)rmtp;

if (rmtp && put_compat_timespec(&rmt, rmtp))
Expand Down
4 changes: 0 additions & 4 deletions kernel/hrtimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -1340,8 +1340,6 @@ long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
struct hrtimer_sleeper t;
struct timespec __user *rmtp;

restart->fn = do_no_restart_syscall;

hrtimer_init(&t.timer, restart->arg0, HRTIMER_MODE_ABS);
t.timer.expires.tv64 = ((u64)restart->arg3 << 32) | (u64) restart->arg2;

Expand All @@ -1355,8 +1353,6 @@ long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
return ret;
}

restart->fn = hrtimer_nanosleep_restart;

/* The other values in restart are already filled in */
return -ERESTART_RESTARTBLOCK;
}
Expand Down

0 comments on commit c289b07

Please sign in to comment.