projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix compat futex code for private futexes
[powerpc.git]
/
kernel
/
futex_compat.c
diff --git
a/kernel/futex_compat.c
b/kernel/futex_compat.c
index
50f24ee
..
2747894
100644
(file)
--- a/
kernel/futex_compat.c
+++ b/
kernel/futex_compat.c
@@
-141,24
+141,25
@@
asmlinkage long compat_sys_futex(u32 __user *uaddr, int op, u32 val,
struct compat_timespec __user *utime, u32 __user *uaddr2,
u32 val3)
{
struct compat_timespec __user *utime, u32 __user *uaddr2,
u32 val3)
{
- struct timespec t;
-
unsigned long timeout = MAX_SCHEDULE_TIMEOUT
;
+ struct timespec t
s
;
+
ktime_t t, *tp = NULL
;
int val2 = 0;
int val2 = 0;
+ int cmd = op & FUTEX_CMD_MASK;
- if (utime && (
op == FUTEX_WAIT || op
== FUTEX_LOCK_PI)) {
- if (get_compat_timespec(&t, utime))
+ if (utime && (
cmd == FUTEX_WAIT || cmd
== FUTEX_LOCK_PI)) {
+ if (get_compat_timespec(&t
s
, utime))
return -EFAULT;
return -EFAULT;
- if (!timespec_valid(&t))
+ if (!timespec_valid(&t
s
))
return -EINVAL;
return -EINVAL;
- if (op == FUTEX_WAIT)
- timeout = timespec_to_jiffies(&t) + 1;
- else {
- timeout = t.tv_sec;
- val2 = t.tv_nsec;
- }
+
+ t = timespec_to_ktime(ts);
+ if (cmd == FUTEX_WAIT)
+ t = ktime_add(ktime_get(), t);
+ tp = &t;
}
}
- if (op == FUTEX_REQUEUE || op == FUTEX_CMP_REQUEUE)
+ if (cmd == FUTEX_REQUEUE || cmd == FUTEX_CMP_REQUEUE
+ || cmd == FUTEX_CMP_REQUEUE_PI)
val2 = (int) (unsigned long) utime;
val2 = (int) (unsigned long) utime;
- return do_futex(uaddr, op, val, t
imeout
, uaddr2, val2, val3);
+ return do_futex(uaddr, op, val, t
p
, uaddr2, val2, val3);
}
}