kernel: add a helper to get an owning user namespace for a namespace
[linux-2.6-block.git] / kernel / cgroup.c
index d1c51b7f5221fbfbb85ed3d12e4918a970713829..86b0e8b16426581475b9f6f02d14e03392b5d617 100644 (file)
@@ -6403,12 +6403,18 @@ static void cgroupns_put(struct ns_common *ns)
        put_cgroup_ns(to_cg_ns(ns));
 }
 
+static struct user_namespace *cgroupns_owner(struct ns_common *ns)
+{
+       return to_cg_ns(ns)->user_ns;
+}
+
 const struct proc_ns_operations cgroupns_operations = {
        .name           = "cgroup",
        .type           = CLONE_NEWCGROUP,
        .get            = cgroupns_get,
        .put            = cgroupns_put,
        .install        = cgroupns_install,
+       .owner          = cgroupns_owner,
 };
 
 static __init int cgroup_namespaces_init(void)