mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 00:51:35 +00:00
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;
|
||||
long ret;
|
||||
|
||||
rmtp = (struct compat_timespec __user *)(restart->arg1);
|
||||
restart->arg1 = (unsigned long)&rmt;
|
||||
restart->nanosleep.rmtp = (struct timespec __user *) &rmt;
|
||||
oldfs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
ret = hrtimer_nanosleep_restart(restart);
|
||||
set_fs(oldfs);
|
||||
|
||||
if (ret) {
|
||||
restart->arg1 = (unsigned long)rmtp;
|
||||
rmtp = restart->nanosleep.compat_rmtp;
|
||||
|
||||
if (rmtp && put_compat_timespec(&rmt, rmtp))
|
||||
return -EFAULT;
|
||||
|
@ -89,7 +88,7 @@ asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
|
|||
= ¤t_thread_info()->restart_block;
|
||||
|
||||
restart->fn = compat_nanosleep_restart;
|
||||
restart->arg1 = (unsigned long)rmtp;
|
||||
restart->nanosleep.compat_rmtp = rmtp;
|
||||
|
||||
if (rmtp && put_compat_timespec(&rmt, rmtp))
|
||||
return -EFAULT;
|
||||
|
@ -607,9 +606,9 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart)
|
|||
long err;
|
||||
mm_segment_t oldfs;
|
||||
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();
|
||||
set_fs(KERNEL_DS);
|
||||
err = clock_nanosleep_restart(restart);
|
||||
|
@ -621,7 +620,7 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart)
|
|||
|
||||
if (err == -ERESTART_RESTARTBLOCK) {
|
||||
restart->fn = compat_clock_nanosleep_restart;
|
||||
restart->arg1 = (unsigned long) rmtp;
|
||||
restart->nanosleep.compat_rmtp = rmtp;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
@ -652,7 +651,7 @@ long compat_sys_clock_nanosleep(clockid_t which_clock, int flags,
|
|||
if (err == -ERESTART_RESTARTBLOCK) {
|
||||
restart = ¤t_thread_info()->restart_block;
|
||||
restart->fn = compat_clock_nanosleep_restart;
|
||||
restart->arg1 = (unsigned long) rmtp;
|
||||
restart->nanosleep.compat_rmtp = rmtp;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue