aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/compat.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-02-10 03:17:43 -0500
committerThomas Gleixner <tglx@linutronix.de>2008-04-17 06:22:30 -0400
commit029a07e0311c7fef968d44b50beca53969cee40b (patch)
treea062017b78508e5d91d7063e24f374c21215ff02 /kernel/compat.c
parenta332d86d3c262cddd3de0bfa90e1910de60b4f95 (diff)
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>
Diffstat (limited to 'kernel/compat.c')
-rw-r--r--kernel/compat.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/kernel/compat.c b/kernel/compat.c
index 5f0e201bcfd3..9c48abfcd4a5 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -47,15 +47,14 @@ static long compat_nanosleep_restart(struct restart_block *restart)
47 mm_segment_t oldfs; 47 mm_segment_t oldfs;
48 long ret; 48 long ret;
49 49
50 rmtp = (struct compat_timespec __user *)(restart->arg1); 50 restart->nanosleep.rmtp = (struct timespec __user *) &rmt;
51 restart->arg1 = (unsigned long)&rmt;
52 oldfs = get_fs(); 51 oldfs = get_fs();
53 set_fs(KERNEL_DS); 52 set_fs(KERNEL_DS);
54 ret = hrtimer_nanosleep_restart(restart); 53 ret = hrtimer_nanosleep_restart(restart);
55 set_fs(oldfs); 54 set_fs(oldfs);
56 55
57 if (ret) { 56 if (ret) {
58 restart->arg1 = (unsigned long)rmtp; 57 rmtp = restart->nanosleep.compat_rmtp;
59 58
60 if (rmtp && put_compat_timespec(&rmt, rmtp)) 59 if (rmtp && put_compat_timespec(&rmt, rmtp))
61 return -EFAULT; 60 return -EFAULT;
@@ -89,7 +88,7 @@ asmlinkage long compat_sys_nanosleep(struct compat_timespec __user *rqtp,
89 = &current_thread_info()->restart_block; 88 = &current_thread_info()->restart_block;
90 89
91 restart->fn = compat_nanosleep_restart; 90 restart->fn = compat_nanosleep_restart;
92 restart->arg1 = (unsigned long)rmtp; 91 restart->nanosleep.compat_rmtp = rmtp;
93 92
94 if (rmtp && put_compat_timespec(&rmt, rmtp)) 93 if (rmtp && put_compat_timespec(&rmt, rmtp))
95 return -EFAULT; 94 return -EFAULT;
@@ -607,9 +606,9 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart)
607 long err; 606 long err;
608 mm_segment_t oldfs; 607 mm_segment_t oldfs;
609 struct timespec tu; 608 struct timespec tu;
610 struct compat_timespec *rmtp = (struct compat_timespec *)(restart->arg1); 609 struct compat_timespec *rmtp = restart->nanosleep.compat_rmtp;
611 610
612 restart->arg1 = (unsigned long) &tu; 611 restart->nanosleep.rmtp = (struct timespec __user *) &tu;
613 oldfs = get_fs(); 612 oldfs = get_fs();
614 set_fs(KERNEL_DS); 613 set_fs(KERNEL_DS);
615 err = clock_nanosleep_restart(restart); 614 err = clock_nanosleep_restart(restart);
@@ -621,7 +620,7 @@ static long compat_clock_nanosleep_restart(struct restart_block *restart)
621 620
622 if (err == -ERESTART_RESTARTBLOCK) { 621 if (err == -ERESTART_RESTARTBLOCK) {
623 restart->fn = compat_clock_nanosleep_restart; 622 restart->fn = compat_clock_nanosleep_restart;
624 restart->arg1 = (unsigned long) rmtp; 623 restart->nanosleep.compat_rmtp = rmtp;
625 } 624 }
626 return err; 625 return err;
627} 626}
@@ -652,7 +651,7 @@ long compat_sys_clock_nanosleep(clockid_t which_clock, int flags,
652 if (err == -ERESTART_RESTARTBLOCK) { 651 if (err == -ERESTART_RESTARTBLOCK) {
653 restart = &current_thread_info()->restart_block; 652 restart = &current_thread_info()->restart_block;
654 restart->fn = compat_clock_nanosleep_restart; 653 restart->fn = compat_clock_nanosleep_restart;
655 restart->arg1 = (unsigned long) rmtp; 654 restart->nanosleep.compat_rmtp = rmtp;
656 } 655 }
657 return err; 656 return err;
658} 657}