drm/amd/pm: update the data strucutre for SMU metrics exchange
[linux-2.6-microblaze.git] / kernel / nsproxy.c
index cd35663..12dd41b 100644 (file)
@@ -262,8 +262,8 @@ void exit_task_namespaces(struct task_struct *p)
 static int check_setns_flags(unsigned long flags)
 {
        if (!flags || (flags & ~(CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWIPC |
-                                CLONE_NEWNET | CLONE_NEWUSER | CLONE_NEWPID |
-                                CLONE_NEWCGROUP)))
+                                CLONE_NEWNET | CLONE_NEWTIME | CLONE_NEWUSER |
+                                CLONE_NEWPID | CLONE_NEWCGROUP)))
                return -EINVAL;
 
 #ifndef CONFIG_USER_NS
@@ -290,6 +290,10 @@ static int check_setns_flags(unsigned long flags)
        if (flags & CLONE_NEWNET)
                return -EINVAL;
 #endif
+#ifndef CONFIG_TIME_NS
+       if (flags & CLONE_NEWTIME)
+               return -EINVAL;
+#endif
 
        return 0;
 }
@@ -464,6 +468,14 @@ static int validate_nsset(struct nsset *nsset, struct pid *pid)
        }
 #endif
 
+#ifdef CONFIG_TIME_NS
+       if (flags & CLONE_NEWTIME) {
+               ret = validate_ns(nsset, &nsp->time_ns->ns);
+               if (ret)
+                       goto out;
+       }
+#endif
+
 out:
        if (pid_ns)
                put_pid_ns(pid_ns);
@@ -507,6 +519,11 @@ static void commit_nsset(struct nsset *nsset)
                exit_sem(me);
 #endif
 
+#ifdef CONFIG_TIME_NS
+       if (flags & CLONE_NEWTIME)
+               timens_commit(me, nsset->nsproxy->time_ns);
+#endif
+
        /* transfer ownership */
        switch_task_namespaces(me, nsset->nsproxy);
        nsset->nsproxy = NULL;