diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-10-31 22:56:04 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-04 14:31:00 -0500 |
commit | 435d5f4bb2ccba3b791d9ef61d2590e30b8e806e (patch) | |
tree | d482ef15334a703bbe406dab021880ce3d320870 /fs | |
parent | cac7f2429872d3733dc3f9915857b1691da2eb2f (diff) |
common object embedded into various struct ....ns
for now - just move corresponding ->proc_inum instances over there
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/mount.h | 3 | ||||
-rw-r--r-- | fs/namespace.c | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/fs/mount.h b/fs/mount.h index f82c62840905..0ad6f760ce52 100644 --- a/fs/mount.h +++ b/fs/mount.h | |||
@@ -1,10 +1,11 @@ | |||
1 | #include <linux/mount.h> | 1 | #include <linux/mount.h> |
2 | #include <linux/seq_file.h> | 2 | #include <linux/seq_file.h> |
3 | #include <linux/poll.h> | 3 | #include <linux/poll.h> |
4 | #include <linux/ns_common.h> | ||
4 | 5 | ||
5 | struct mnt_namespace { | 6 | struct mnt_namespace { |
6 | atomic_t count; | 7 | atomic_t count; |
7 | unsigned int proc_inum; | 8 | struct ns_common ns; |
8 | struct mount * root; | 9 | struct mount * root; |
9 | struct list_head list; | 10 | struct list_head list; |
10 | struct user_namespace *user_ns; | 11 | struct user_namespace *user_ns; |
diff --git a/fs/namespace.c b/fs/namespace.c index 5b66b2b3624d..adc2ea2532a0 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -2640,7 +2640,7 @@ dput_out: | |||
2640 | 2640 | ||
2641 | static void free_mnt_ns(struct mnt_namespace *ns) | 2641 | static void free_mnt_ns(struct mnt_namespace *ns) |
2642 | { | 2642 | { |
2643 | proc_free_inum(ns->proc_inum); | 2643 | proc_free_inum(ns->ns.inum); |
2644 | put_user_ns(ns->user_ns); | 2644 | put_user_ns(ns->user_ns); |
2645 | kfree(ns); | 2645 | kfree(ns); |
2646 | } | 2646 | } |
@@ -2662,7 +2662,7 @@ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *user_ns) | |||
2662 | new_ns = kmalloc(sizeof(struct mnt_namespace), GFP_KERNEL); | 2662 | new_ns = kmalloc(sizeof(struct mnt_namespace), GFP_KERNEL); |
2663 | if (!new_ns) | 2663 | if (!new_ns) |
2664 | return ERR_PTR(-ENOMEM); | 2664 | return ERR_PTR(-ENOMEM); |
2665 | ret = proc_alloc_inum(&new_ns->proc_inum); | 2665 | ret = proc_alloc_inum(&new_ns->ns.inum); |
2666 | if (ret) { | 2666 | if (ret) { |
2667 | kfree(new_ns); | 2667 | kfree(new_ns); |
2668 | return ERR_PTR(ret); | 2668 | return ERR_PTR(ret); |
@@ -3201,7 +3201,7 @@ static int mntns_install(struct nsproxy *nsproxy, void *ns) | |||
3201 | static unsigned int mntns_inum(void *ns) | 3201 | static unsigned int mntns_inum(void *ns) |
3202 | { | 3202 | { |
3203 | struct mnt_namespace *mnt_ns = ns; | 3203 | struct mnt_namespace *mnt_ns = ns; |
3204 | return mnt_ns->proc_inum; | 3204 | return mnt_ns->ns.inum; |
3205 | } | 3205 | } |
3206 | 3206 | ||
3207 | const struct proc_ns_operations mntns_operations = { | 3207 | const struct proc_ns_operations mntns_operations = { |