VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   57 Tags
author: Andrey Vagin <avagin@openvz.org> 2016-09-06 00:47:13 -0700 committer: Eric W. Biederman <ebiederm@xmission.com> 2016-09-22 19:59:39 -0500 commit: bcac25a58bfc6bd79191ac5d7afb49bea96da8c9 parent: 29b4817d4018df78086157ea3a55c1d9424a7cfc
Commit Summary:
kernel: add a helper to get an owning user namespace for a namespace
Diffstat:
1 file changed, 6 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 7bb2cda3bfef..fea56f310547 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -3348,10 +3348,16 @@ static int mntns_install(struct nsproxy *nsproxy, struct ns_common *ns)
 	return 0;
 }
 
+static struct user_namespace *mntns_owner(struct ns_common *ns)
+{
+	return to_mnt_ns(ns)->user_ns;
+}
+
 const struct proc_ns_operations mntns_operations = {
 	.name		= "mnt",
 	.type		= CLONE_NEWNS,
 	.get		= mntns_get,
 	.put		= mntns_put,
 	.install	= mntns_install,
+	.owner		= mntns_owner,
 };