hrtimer: use nanosleep specific restart_block fields
Convert all the nanosleep related users of restart_block to the new nanosleep specific restart_block fields. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
This commit is contained in:
parent
a332d86d3c
commit
029a07e031
2 changed files with 13 additions and 15 deletions
|
@ -47,15 +47,14 @@ static long compat_nanosleep_restart(struct restart_block *restart)
|
||||||
mm_segment_t oldfs;
|
mm_segment_t oldfs;
|
||||||
long ret;
|
long ret;
|
||||||
|
|
||||||
rmtp = (struct compat_timespec __user *)(restart->arg1);
|
restart->nanosleep.rmtp = (struct timespec __user *) &rmt;
|
||||||
restart->arg1 = (unsigned long)&rmt;
|
|
||||||
oldfs = get_fs();
|
oldfs = get_fs();
|
||||||
set_fs(KERNEL_DS);
|
set_fs(KERNEL_DS);
|
||||||
ret = hrtimer_nanosleep_restart(restart);
|
ret = hrtimer_nanosleep_restart(restart);
|
||||||
set_fs(oldfs);
|
set_fs(oldfs);
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
restart->arg1 = (unsigned long)rmtp;
|
rmtp = restart->nanosleep.compat_rmtp;
|
||||||
|
|
||||||
if (rmtp && put_compat_timespec(&rmt, rmtp))
|
if (rmtp && put_compat_timespec(&rmt, rmtp))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
@ -89,7 +88,7 @@ asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
|
||||||
= ¤t_thread_info()->restart_block;
|
= ¤t_thread_info()->restart_block;
|
||||||
|
|
||||||
restart->fn = compat_nanosleep_restart;
|
restart->fn = compat_nanosleep_restart;
|
||||||
restart->arg1 = (unsigned long)rmtp;
|
restart->nanosleep.compat_rmtp = rmtp;
|
||||||
|
|
||||||
if (rmtp && put_compat_timespec(&rmt, rmtp))
|
if (rmtp && put_compat_timespec(&rmt, rmtp))
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
@ -607,9 +606,9 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart)
|
||||||
long err;
|
long err;
|
||||||
mm_segment_t oldfs;
|
mm_segment_t oldfs;
|
||||||
struct timespec tu;
|
struct timespec tu;
|
||||||
struct compat_timespec *rmtp = (struct compat_timespec *)(restart->arg1);
|
struct compat_timespec *rmtp = restart->nanosleep.compat_rmtp;
|
||||||
|
|
||||||
restart->arg1 = (unsigned long) &tu;
|
restart->nanosleep.rmtp = (struct timespec __user *) &tu;
|
||||||
oldfs = get_fs();
|
oldfs = get_fs();
|
||||||
set_fs(KERNEL_DS);
|
set_fs(KERNEL_DS);
|
||||||
err = clock_nanosleep_restart(restart);
|
err = clock_nanosleep_restart(restart);
|
||||||
|
@ -621,7 +620,7 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart)
|
||||||
|
|
||||||
if (err == -ERESTART_RESTARTBLOCK) {
|
if (err == -ERESTART_RESTARTBLOCK) {
|
||||||
restart->fn = compat_clock_nanosleep_restart;
|
restart->fn = compat_clock_nanosleep_restart;
|
||||||
restart->arg1 = (unsigned long) rmtp;
|
restart->nanosleep.compat_rmtp = rmtp;
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -652,7 +651,7 @@ long compat_sys_clock_nanosleep(clockid_t which_clock, int flags,
|
||||||
if (err == -ERESTART_RESTARTBLOCK) {
|
if (err == -ERESTART_RESTARTBLOCK) {
|
||||||
restart = ¤t_thread_info()->restart_block;
|
restart = ¤t_thread_info()->restart_block;
|
||||||
restart->fn = compat_clock_nanosleep_restart;
|
restart->fn = compat_clock_nanosleep_restart;
|
||||||
restart->arg1 = (unsigned long) rmtp;
|
restart->nanosleep.compat_rmtp = rmtp;
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1354,13 +1354,13 @@ long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
|
||||||
struct hrtimer_sleeper t;
|
struct hrtimer_sleeper t;
|
||||||
struct timespec __user *rmtp;
|
struct timespec __user *rmtp;
|
||||||
|
|
||||||
hrtimer_init(&t.timer, restart->arg0, HRTIMER_MODE_ABS);
|
hrtimer_init(&t.timer, restart->nanosleep.index, HRTIMER_MODE_ABS);
|
||||||
t.timer.expires.tv64 = ((u64)restart->arg3 << 32) | (u64) restart->arg2;
|
t.timer.expires.tv64 = restart->nanosleep.expires;
|
||||||
|
|
||||||
if (do_nanosleep(&t, HRTIMER_MODE_ABS))
|
if (do_nanosleep(&t, HRTIMER_MODE_ABS))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
rmtp = (struct timespec __user *)restart->arg1;
|
rmtp = restart->nanosleep.rmtp;
|
||||||
if (rmtp) {
|
if (rmtp) {
|
||||||
int ret = update_rmtp(&t.timer, rmtp);
|
int ret = update_rmtp(&t.timer, rmtp);
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
|
@ -1394,10 +1394,9 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
|
||||||
|
|
||||||
restart = ¤t_thread_info()->restart_block;
|
restart = ¤t_thread_info()->restart_block;
|
||||||
restart->fn = hrtimer_nanosleep_restart;
|
restart->fn = hrtimer_nanosleep_restart;
|
||||||
restart->arg0 = (unsigned long) t.timer.base->index;
|
restart->nanosleep.index = t.timer.base->index;
|
||||||
restart->arg1 = (unsigned long) rmtp;
|
restart->nanosleep.rmtp = rmtp;
|
||||||
restart->arg2 = t.timer.expires.tv64 & 0xFFFFFFFF;
|
restart->nanosleep.expires = t.timer.expires.tv64;
|
||||||
restart->arg3 = t.timer.expires.tv64 >> 32;
|
|
||||||
|
|
||||||
return -ERESTART_RESTARTBLOCK;
|
return -ERESTART_RESTARTBLOCK;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue