alpha: use asm-generic/mmu_context.h for no-op implementations
[linux-2.6-microblaze.git] / kernel / futex.c
index a587669..be68ac0 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/freezer.h>
 #include <linux/memblock.h>
 #include <linux/fault-inject.h>
+#include <linux/time_namespace.h>
 
 #include <asm/futex.h>
 
@@ -916,7 +917,7 @@ static inline void exit_pi_state_list(struct task_struct *curr) { }
  * [10] Found  | Found    | task      | !=taskTID | 0/1    | Invalid
  *
  * [1] Indicates that the kernel can acquire the futex atomically. We
- *     came came here due to a stale FUTEX_WAITERS/FUTEX_OWNER_DIED bit.
+ *     came here due to a stale FUTEX_WAITERS/FUTEX_OWNER_DIED bit.
  *
  * [2] Valid, if TID does not belong to a kernel thread. If no matching
  *      thread is found then it indicates that the owner TID has died.
@@ -3797,6 +3798,8 @@ SYSCALL_DEFINE6(futex, u32 __user *, uaddr, int, op, u32, val,
                t = timespec64_to_ktime(ts);
                if (cmd == FUTEX_WAIT)
                        t = ktime_add_safe(ktime_get(), t);
+               else if (!(op & FUTEX_CLOCK_REALTIME))
+                       t = timens_ktime_to_host(CLOCK_MONOTONIC, t);
                tp = &t;
        }
        /*
@@ -3989,6 +3992,8 @@ SYSCALL_DEFINE6(futex_time32, u32 __user *, uaddr, int, op, u32, val,
                t = timespec64_to_ktime(ts);
                if (cmd == FUTEX_WAIT)
                        t = ktime_add_safe(ktime_get(), t);
+               else if (!(op & FUTEX_CLOCK_REALTIME))
+                       t = timens_ktime_to_host(CLOCK_MONOTONIC, t);
                tp = &t;
        }
        if (cmd == FUTEX_REQUEUE || cmd == FUTEX_CMP_REQUEUE ||